目前已知会导致HMR无法使用
Warning: RouterContext: React.createClass is deprecated and will be removed in version 16. Use plain JavaScript classes instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.
目前解决方法是限制react的版本
"react": "15.4.2",
"react-dom": "15.4.2"
针对这一问题,react-router 的 issue: https://github.com/ReactTraining/react-router/issues/4932
这里说会更新 [email protected] 版本的相关问题,那么 dva 内部引用的 [email protected] 已经半年多没有更新了,dva 是推动 [email protected] 版本的更新还是有切换到 [email protected] 版本的计划?
@pinggod 我觉得dva切到react-router v4才是正道, 继续用3的话一直会落后react-router一个版本 总感觉不讨好
刚才看了下@pinggod 的连接,看样子这两个都是一个原因了。
Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.
Warning: RouterContext: React.createClass is deprecated and will be removed in version 16. Use plain JavaScript classes instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.
@phnessu4 第一个 warning 有可能是其他第三方依赖的问题,比如如果你的项目使用了 antd,那么也会抛出这一个 warning。
@pinggod 不排除antd也有问题,antd还没独立看。刚才找了个dva的demo看了眼,一开始没添加antd的commit就有问题。
+1
Most helpful comment
@pinggod 我觉得dva切到react-router v4才是正道, 继续用3的话一直会落后react-router一个版本 总感觉不讨好