-
Notifications
You must be signed in to change notification settings - Fork 260
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
Support for defaultProps will be removed from function components in a future major release. #1488
Comments
最后只能过滤掉这个报错 const error = console.error;
console.error = (...args: any) => {
if (/defaultProps/.test(args[0])) return;
error(...args);
}; |
同样的问题 |
20 tasks
请问如何解决掉这个报错警告?很烦人! |
20 tasks
React 版本 <= 18.2.0 时,不会有这个警告。 |
降成 18.2.0 确实没这个提示了 |
18.0.0还有 |
官方啥时候能修复这个问题呀?最新版 2.6.14 依然会报错: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NutUI React 包名
@nutui/nutui-react
NutUI React 版本号
2.0.18
平台
h5
重现链接
https://github.com/kurisu994/next-nutui-demo
重现步骤
启动后访问 localhost:3000/login页面就会提示。
Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
期望的结果是什么?
没有这个警告
实际的结果是什么?
几乎所有nutui的组件都会有这个警告
环境信息
System:
OS: macOS 13.5.2
CPU: (10) arm64 Apple M1 Max
Memory: 667.27 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.18.0 - /opt/homebrew/opt/node@18/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 9.8.1 - /opt/homebrew/opt/node@18/bin/npm
Watchman: 2023.09.18.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 116.0.5845.187
Safari: 16.6
npmPackages:
@nutui/nutui-react: ^2.0.18 => 2.0.18
其他补充信息
No response
The text was updated successfully, but these errors were encountered: