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
Select组件,当导入 'react-hot-loader/patch'时就会报错 #3550
Comments
找到原因了吗?我也遇到这个情况,一堆warning。有点烦人 |
+1 |
和 Table.Column 的判断是一样的?@yesmeck |
react-hot-loader 会用 react-proxy 改掉原来的组件对象,要想想怎么搞。 |
有 hack 的办法,不过感觉这是 react-hot-loader 的问题。 |
hack 的办法比较搓: // 给 Option 自定义个 `__name`
Option.__name = 'rc-select-option' 后面要比较的地方用这个 |
为什么不用 displayName 呢? |
displayName 太容易冲突了。 |
其实冲突的可能性很小,只有当谁用了 rc-select-option 并且还传给 Antd 的 Select 组件了才会出问题 |
|
开发环境各工具之间难免有冲突。我不认为这个问题能够解决,而且不影响到生产环境,也还好。
这个可以像 antd 这样,限制每个 warning 只会显示一次。 |
Any update on this? Though it's not good to ask so but this is a very critical issue. It's not just warnings for I understand it's more like an issue of RHL. But it's just how RHL works. I don't think it could be resolved by RHL itself. And, high order component concept is widely accepted for React so |
It seems that there is no better way... |
给 react-proxy 提了个 issue gaearon/react-proxy#68 |
Traced in #4655. |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
当我使用react-hot-loader3的时候,入口文件中导入 'react-hot-loader/patch'
import 'react-hot-loader/patch'
所有引用Select组件的地方就会报这个错:
Warning: the children of
Select
should beSelect.Option
orSelect.OptGroup
, instead ofOption
.我去掉'react-hot-loader/patch‘就好了不知道怎么回事,反复检查没发现原因
The text was updated successfully, but these errors were encountered: