callstack / callstack/react-theme-provider

Improve support for React v18

Offen
#144 3 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
467
Forks
53
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi! 👋

Firstly, thanks for your work on this project! 🙂

With React v18 children is expected to be explicitly typed

I've used [patch-package](https://github.com/ds300/patch-package) to patch `@callstack/react-theme-provider@3.0.8`

Here is the diff that solved my problem:

```diff
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 extends any ? Pick = { [P in keyof T]?: $DeepPartial };

export type ThemingType = {
- ThemeProvider: React.ComponentType<{ theme?: Theme }>;
+ ThemeProvider: React.ComponentType<{ theme?: Theme; children: React.ReactNode }>;
withTheme: (
WrappedComponent: React.ComponentType & C
) => React.ComponentType<
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.