ошибка Binding element 'children' implicitly has an 'any' type.
import {
useDispatch
} from 'react-redux'
export function Button({fn, children:}) {
const dispatch = useDispatch()
return (
<button
onClick={() => dispatch(fn())}
>
{children}
</button>
)
}
https://www.typescriptlang.org/play?ts=5.1.3&ssl=17&ssc=2&pln=1&pc=1#code/JYWwDg9gTgLgBAbwFBzgVwM4FMAiwNgCGMAxgBZIC+cAZlBCHAORRaEkwC0rAJmgB5MkwrP0ixaaAHYdgEKXABCaGDHkAKBDSkAaOOWAAbHqykAuSgEpEw1CXkZ4PfEVJk4AXnTY8BYuXVLFDhWGDQoBXVg1AAeACMVNSlbVFT5AGFDYBIAaw8EQM8APjhnPzd1bUDLSmi4IrrUBANjU1rUuBiAegTVeQbUIMogA
у тебя не описаны типы children и fn
Обсуждают сегодня