There is another utility type for components, that should not accept childrens - React.VFC - that type does not extend props with children attribute.
Your screenshot with function Greeteng({ children }: FC) error: React.FC is alias for type that represents function, not properties object, thats why you facing error. Most common way to define type for props in such situation is to use PropsWithChildren utility type from React
There is another utility type for components, that should not accept childrens -
React.VFC
- that type does not extend props with children attribute.Your screenshot with
function Greeteng({ children }: FC)
error:React.FC
is alias for type that represents function, not properties object, thats why you facing error. Most common way to define type for props in such situation is to usePropsWithChildren
utility type from ReactOr if you don't need children just type props like these:
You won't loose types in JSX code.
PropsWithChildren
is TIL 🙌Thank you