Typescript: missing children on ShadowProps
Czino opened this issue · comments
I encountered the following error when using
Property 'children' does not exist on type 'IntrinsicAttributes & ShadowProps'.ts(2322)
Even for the simplest code:
<Shadow>
<TextInput/>
</Shadow>
I could only solve it by adding children?: ReactNode;
to the ShadowProps
This is strange.
The Shadow
component is defined by export const Shadow: React.FC<ShadowProps> = ...
, and React.FC automatically adds the children
property to the component type. The ShadowProps type doesn't have it, but does the Shadow.
What version of react-native-shadow-2 and @types/react are you using?
I can add the children?: React.ReactNode;
to the ShadowProps (just saw that ViewProps for example has it), but I don't see how you are having this issue
I believe this issue is likely from the @types/react 18 upgrade:
I believe this issue is likely from the @types/react 18 upgrade:
Thanks. Tomorrow I will release a hotfix.