Hello I have a problem on how I will pass my props to a children:
interface RootState {
sideIsOpen: boolean;
isOpen: boolean;
}
const SideNavigation: React.FC = () => {
// const { sideIsOpen } = useSelector((RootState) => RootState.toggleSide);
const selectIsOpen = (state: RootState) => state.sideIsOpen;
const sideIsOpen = useSelector(selectIsOpen);
return (
<SideNav>
<LogoNavigation isOpen={sideIsOpen} />
</SideNav>
);
};
and my children:
const LogoNavigation: React.FC = (props) => {
return (
<LogoSide>
<img src={Logo} alt="Logo Elo Ghost" />
</LogoSide>
);
};
i got this error:
Type '{ isOpen: boolean; }' is not assignable to type 'IntrinsicAttributes & { children?: ReactNode; }'. Property 'isOpen' does not exist on type 'IntrinsicAttributes & { children?: ReactNode; }'.ts(2322)
LogoNavigation
? – keikaiisOpen
is not a property ofLogoNavigation
. – Mario Vernari