Skip to content
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

新创建的App自动使用最新版React.js deprecated的问题 #811

Closed
DickyT opened this issue Apr 11, 2017 · 6 comments
Closed

新创建的App自动使用最新版React.js deprecated的问题 #811

DickyT opened this issue Apr 11, 2017 · 6 comments

Comments

@DickyT
Copy link

DickyT commented Apr 11, 2017

目前已知会导致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"
@thinkininfinity
Copy link

针对这一问题,react-router 的 issue: remix-run/react-router#4932

这里说会更新 [email protected] 版本的相关问题,那么 dva 内部引用的 [email protected] 已经半年多没有更新了,dva 是推动 [email protected] 版本的更新还是有切换到 [email protected] 版本的计划?

@DickyT
Copy link
Author

DickyT commented Apr 11, 2017

@PINGGOD 我觉得dva切到react-router v4才是正道, 继续用3的话一直会落后react-router一个版本 总感觉不讨好

@phnessu4
Copy link

刚才看了下@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.

@thinkininfinity
Copy link

@phnessu4 第一个 warning 有可能是其他第三方依赖的问题,比如如果你的项目使用了 antd,那么也会抛出这一个 warning。

@phnessu4
Copy link

@PINGGOD 不排除antd也有问题,antd还没独立看。刚才找了个dva的demo看了眼,一开始没添加antd的commit就有问题。

@jmas
Copy link

jmas commented May 30, 2017

+1

@sorrycc sorrycc closed this as completed Sep 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants