-
Notifications
You must be signed in to change notification settings - Fork 637
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
Cannot convert undefined or null to object #154
Comments
可以看下你使用组件的代码吗?是因为 onEvents 为 null 吗? |
onEvents没有传过,也没有用过,错误提示给你吧: Uncaught TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at ProxyComponent.componentDidUpdate (core.js:139)
at commitLifeCycles (react-dom.development.js:8778)
at commitAllLifeCycles (react-dom.development.js:9946)
... |
理论上,onEvents 如果是 undefined 的话,会自动转成 {}。 现在的情况应该是 onEvents 传了 null 了。 Object.keys(null); 上面的代码就会报 可以看一下你具体的代码片段吗? |
已解决。因为继承ReactEchartsCore,然后在子类增加自定义的defaultProps。正确做法是 Object.assign({}, ReactEchartsCore.defaultProps, ...); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
从2.0.6升级到2.0.7用不了,错误定位到 componentDidUpdate 的 prevProps.onEvents。错误是从react-dom发出来的,没啥卵用。回滚到2.0.6恢复正常。
The text was updated successfully, but these errors were encountered: