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

Component deprecation warning due to React upgrading to v15.5.0 #5678

Closed
mdluo opened this issue Apr 9, 2017 · 40 comments
Closed

Component deprecation warning due to React upgrading to v15.5.0 #5678

mdluo opened this issue Apr 9, 2017 · 40 comments
Assignees

Comments

@mdluo
Copy link

mdluo commented Apr 9, 2017

Version

2.9.1

Environment

Chrome 56

Reproduction link

http://codepen.io/benjycui/pen/KgPZrE

Steps to reproduce

N.A.

What is expected?

No such warning messages

What is actually happening?

Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.

Warning: AnimateChild: 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.


https://github.com/facebook/react/releases/tag/v15.5.0

@afc163
Copy link
Member

afc163 commented Apr 9, 2017

Happen earlier than we expect: #5377

@afc163
Copy link
Member

afc163 commented Apr 9, 2017

@igor-lemon
Copy link

+1

@afc163
Copy link
Member

afc163 commented Apr 10, 2017

@yesmeck
Copy link
Member

yesmeck commented Apr 12, 2017

prop-types doesn't work with react under 15.3.0. If we introduce prop-types, that means antd must depend on react 15.3.0+;

@afc163
Copy link
Member

afc163 commented Apr 12, 2017

prop-types doesn't work with react under 15.3.0

What's the problem?

@yesmeck
Copy link
Member

yesmeck commented Apr 12, 2017

@afc163
Copy link
Member

afc163 commented Apr 12, 2017

"Warning: Failed prop type: Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types
    in Unknown (created by Component)
    in Component"

@afc163
Copy link
Member

afc163 commented Apr 12, 2017

I think it is OK, there is no reason to stay in react@15.1 or react@15.2.

@yesmeck
Copy link
Member

yesmeck commented Apr 12, 2017

Should we add "react": "^15.5.0" to peerDependencies as prop-types recommend https://github.com/reactjs/prop-types#how-to-depend-on-this-package?

@paranoidjk
Copy link
Contributor

rc-slider 7.0.1
rc-checkbox 2.0.0

@vauruk
Copy link

vauruk commented Apr 16, 2017

I find this information, for react 15.5.
https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html

@39Er
Copy link

39Er commented May 8, 2017

Until now, I find there are also lots of warnings , for example in rc-form and rc-select.Except for using
react v15.4, when will antd support v15.5 without warnings? It seems like a huge change...

@gaearon
Copy link

gaearon commented May 12, 2017

Please see facebook/prop-types#38.

This was a false positive caused by production version of prop-types generating a mistaken warning when development version of React is calling it.

It is fixed in prop-types@15.5.10.

You might need to rebuild the UMD bundle of the component that depends on prop-types (probably this repo) to see the changes.

@afc163
Copy link
Member

afc163 commented May 18, 2017

I believe all warnings are fixed in master now, and will be released in 2.10.2 at this weekend. 🎉

@afc163 afc163 closed this as completed May 18, 2017
@enzolutions
Copy link

@afc163 you mean 2.10.2 📦

@crazyair
Copy link
Member

crazyair commented May 19, 2017

天天等着这个 就怕这周改不完 发不了版 那得等到下周五了
Every day waiting for this and they were afraid this week, we don't change the edition That have to wait until next Friday

@afc163
Copy link
Member

afc163 commented May 23, 2017

2.10.2 is released!

@pleunv
Copy link

pleunv commented May 23, 2017

For some reason yarn is still getting rc-switch@1.4.3 instead of 1.4.4 after an install/upgrade, any idea why? 1.4.4 satisfies ~1.4.2 and is correctly published on npm, beats me...

edit: either a yarn --force or a yarn remove antd && yarn add antd fixed this... not sure if this is normal behavior.

@39Er
Copy link

39Er commented May 23, 2017

update to 2.10.2,but there's still two warnings:

  1. warning: Failed prop type: Calling PropTypes validators directly is not supported by the prop-types package. Use PropTypes.checkPropTypes() to call them.

  2. Warning: getDefaultProps is only used on classic React.createClass definitions. Use a static property named defaultProps instead.

In my project,I only use antd and react-router v4 which are related to react,what's the problem?

@xkrsz
Copy link

xkrsz commented May 23, 2017

I also updated to 2.10.2 and I keep getting this error:

Warning: Form: 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.

@afc163
Copy link
Member

afc163 commented May 23, 2017

Try yarn upgrade?

@butfunny
Copy link

i updated to 2.10.2 and getting this error:
Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.

@xkrsz
Copy link

xkrsz commented May 23, 2017

@afc163 Thanks, that fixed it.

@zhulinpinyu
Copy link

I have tried yarn upgrade, also got same warning. antd 2.10.2 react 15.5.4

@benjycui
Copy link
Contributor

@zhulinpinyu could you try to find out the component which had printed this warning? Thanks.

@crazyair
Copy link
Member

crazyair commented May 24, 2017

引用的组件太多,可能是别的组件报的错误。
react-router 如果用 2.X 会有React.createClass 报错
react-router 如果用 3,x 就没有 React.createClass 但是还是会有 prop-types 报错
但是这个错误 到底是哪个组件的错误 就不知道了
remix-run/react-router#5121

@39Er
Copy link

39Er commented May 26, 2017

can someone tell me why I got those two warnings in my previous comment?

@crazyair
Copy link
Member

The problem of other plug-ins, with screening and see which plug-in version is low

@lock
Copy link

lock bot commented May 26, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators May 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests