Improve support for React v18
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, react
- Domain
- frontend
Research direction
Start by locating the package typings at typings/index.d.ts, using the supplied patch as the expected change. Verify the React v18 type requirement and confirm that the published package typings allow ThemeProvider children without breaking existing type usage.
Written by the indexing model from the issue text.
Description
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<
- Dominant language
- JavaScript
- Stars
- 466
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstack/react-theme-provider
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
question
Difficulty 5/5 Over a week Newbie friendliness 10/100
callstack/react-theme-provider#156 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
callstack/react-theme-provider#139 · 1 comment · 12 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
callstack/react-theme-provider#130 · 2 comments · 1 reaction ·
All issues in callstack/react-theme-provider
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·