Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThemeProvider children type error #56

Open
Tobertet opened this issue Mar 2, 2023 · 4 comments
Open

ThemeProvider children type error #56

Tobertet opened this issue Mar 2, 2023 · 4 comments

Comments

@Tobertet
Copy link

Tobertet commented Mar 2, 2023

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
Copy link

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

@kmefeu
Copy link

kmefeu commented Jun 15, 2023

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

@ghmendonca
Copy link

@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
Copy link

kmefeu commented Jun 16, 2023

@ghmendonca Thank you for your feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants