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

Improve support for React v18 #144

Open
kennethlynne opened this issue Sep 27, 2022 · 3 comments
Open

Improve support for React v18 #144

kennethlynne opened this issue Sep 27, 2022 · 3 comments

Comments

@kennethlynne
Copy link

kennethlynne commented Sep 27, 2022

Hi! 👋

Firstly, thanks for your work on this project! 🙂

With React v18 children is expected to be explicitly typed

I've used patch-package to patch @callstack/react-theme-provider@3.0.8

Here is the diff that solved my problem:

diff --git a/node_modules/@callstack/react-theme-provider/typings/index.d.ts b/node_modules/@callstack/react-theme-provider/typings/index.d.ts
index fd76d0e..df3cf54 100644
--- a/node_modules/@callstack/react-theme-provider/typings/index.d.ts
+++ b/node_modules/@callstack/react-theme-provider/typings/index.d.ts
@@ -8,7 +8,7 @@ type $Without<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T,
 type $DeepPartial<T> = { [P in keyof T]?: $DeepPartial<T[P]> };
 
 export type ThemingType<Theme> = {
-  ThemeProvider: React.ComponentType<{ theme?: Theme }>;
+  ThemeProvider: React.ComponentType<{ theme?: Theme; children: React.ReactNode }>;
   withTheme: <Props extends { theme: Theme }, C>(
     WrappedComponent: React.ComponentType<Props> & C
   ) => React.ComponentType<
@X7Becka
Copy link

X7Becka commented Jan 10, 2023

Is this package dead?...

@douglasjunior
Copy link

Is this package dead?...

I ask myself the same question.

This package is used in react-native-paper, which is the most important Material Design component lib for React Native.

@douglasjunior
Copy link

Fixed in #155 and released on version 3.0.9

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