callstack / callstack/react-theme-provider
Improve support for React v18
- 主要语言
- JavaScript
- 星标
- 467
- 派生
- 53
- PR 合并指标
- 30 天内没有已合并 PR
描述
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<
```
贡献指南
调研方向
首先定位 typings/index.d.ts 中的包类型定义,并将提供的补丁作为预期更改。验证 React v18 类型要求,并确认已发布包的类型定义允许 ThemeProvider 子元素,同时不会破坏现有的类型用法。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, react
- 领域
- frontend
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100