-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
TypeScript 组件类型错误 #233
Comments
@HerbertHe 请使用 https://codesandbox.io 提供示例,我帮你看看。 |
https://codesandbox.io/s/wonderful-booth-29cwqo?file=/src/App.tsx 这个问题我试了在 codesandbox 上无法复现,可能是与 vscode 或者 typescript 版本有关:
|
我看你示例中使用
@HerbertHe 是不是这个也有可能是个问题? |
应该不是的,我本地环境全都是 |
看上去 @gamecss 好像修复了这个问题 @HerbertHe |
@jaywcjlove 😂我没找到类型定义在哪之前。。 React有提供PropsWithChildren这个泛型类型API的,我感觉直接定义类型为ReactNode似乎不太合适(白天我看看修这个问题) 有计划升级到React18吗(,render方式的更改导致本地总是报错。 |
@HerbertHe 欢迎提交 PR,可以及时处理,有空肯定升级 |
@jaywcjlove 主要是react18与之前的版本并不兼容,可能会有些同学的项目受影响,担心的主要是这个问题。支持react18就得做大版本升级了。 |
@HerbertHe 使用了一种方法支持 React 18,现在支持 react 18 和 17 不需要发布大版本了。 |
@jaywcjlove 你这是把react打包进去了啊😂。。。有没有一种可能使用用户本地的react |
@HerbertHe 研究了一种方法使用 |
The text was updated successfully, but these errors were encountered: