yamankatby / react-native-material

Modular and customizable Material Design UI components for React Native
https://rn-material.js.org
MIT License
223 stars 38 forks source link

ThemeProvider children type error #56

Open Tobertet opened 1 year ago

Tobertet commented 1 year ago

Whenever you wrap something with the ThemeProvider in order to customize the theme, Typescript complains about this:

Property 'children' does not exist on type 'IntrinsicAttributes & ThemeProviderProps'

In order to solve it I had to go to ThemeProvider.d.ts and change line 34 from export declare const ThemeProvider: React.FC<ThemeProviderProps>; to export declare const ThemeProvider: React.FC<PropsWithChildren<ThemeProviderProps>>;

It looks like this is simply a TS typing issue. I would open a PR myself but unfortunately I don't have much time lately.

ghmendonca commented 1 year ago

This issue was mentioned 8 months ago and still not fixed :/ looks like this library is not being maintened anymore

kmefeu commented 1 year ago

@ghmendonca @Tobertet, have you found a solution for that?

ghmendonca commented 1 year ago

@kmefeu no, I ended up adding this comment in the line above the provider:

{/* @ts-expect-error https://github.com/yamankatby/react-native-material/issues/56*/}

kmefeu commented 1 year ago

@ghmendonca Thank you for your feedback