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

Created on 10 Apr 2017  ·  16Comments  ·  Source: react-dnd/react-dnd

Any info when this will be updated?

Most helpful comment

I'm on vacation in the UK at the moment. I'll cut a release early next week

On Wed, May 3, 2017, 11:57 AM Aaron Reisman notifications@github.com
wrote:

@darthtrevino https://github.com/darthtrevino cut a release please :D ❤️


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/react-dnd/react-dnd/issues/731#issuecomment-298880269,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAG7iDLONVBG4QOLzTRC4yn_sh9DiprTks5r2F20gaJpZM4M4iok
.

All 16 comments

This warning is shown when using react 15.5.*. basically, now it's just a warning, but in react16 the application might break. the PropTypes should now be imported from 'prop-types' package, and not from the react package.
The react team encourage us to stay up-to-date with the latest packages.

@chen199 I have a question.
Can I make this warning invisible?

@konojunya well, basically what happens it the react uses console.error( to print the warning to the console. They do it only because they really really really want you to make this error go "the way it should", i.e by fixing the code (which is very easy- simply install the prop-types package, and the import it for the relevant file instead from the React module), or update the other dependencies that cause this error (react-router 3.* for example). This way, you can be sure that on version 16 you'll be safe. of course you can override or workaround this print, but it's really not recommended.

You can use the production version of react which will not throw any
warnings.
On Sat, 15 Apr 2017 at 6:02 PM, Chen notifications@github.com wrote:

@konojunya https://github.com/konojunya well, basically what happens it
the react uses console.error( to print the warning to the console. They do
it only because they really really really want you to make this error go
"the way it should", i.e by fixing the code (which is very easy- simply
install the prop-types package, and the import it for the relevant file
instead from the React module), or update the other dependencies that cause
this error (react-router 3.* for example). This way, you can be sure that
on version 16 you'll be safe. of course you can override or workaround this
print, but it's really not recommended.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/react-dnd/react-dnd/issues/731#issuecomment-294290578,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_31qiig9BCsYZjVYpGOvma4iMX3hBeks5rwLjZgaJpZM4M4iok
.

>

Regards,
Gagan

@chen199 @theTechie Thanks.

I can invisible this warning when set the webpack configure to production.

```js
// webpack.config.js
plugins: [
new webpack.DefinePlugin({
"process.env": {
"NODE_ENV": JSON.stringify("production")
}
})
]
````

This is fixed in the master branch. It would be nice to have a new release.

We need a new release! Or just grab it straight from the git repo...

We need a new release! Or just grab it straight from the git repo...

Grabbing from the git repo fails for me, as npm postinstall is running a lerna command, which isn't packaged as a dependency…

@darthtrevino cut a release please :D ❤️

I'm on vacation in the UK at the moment. I'll cut a release early next week

On Wed, May 3, 2017, 11:57 AM Aaron Reisman notifications@github.com
wrote:

@darthtrevino https://github.com/darthtrevino cut a release please :D ❤️


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/react-dnd/react-dnd/issues/731#issuecomment-298880269,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAG7iDLONVBG4QOLzTRC4yn_sh9DiprTks5r2F20gaJpZM4M4iok
.

Any update?

AFAIK this was released a few days ago.

Having the same warnings. Any updates on the release??

This has been released already

On Mon, May 15, 2017 at 10:13 PM, Mohammed Shaffi notifications@github.com
wrote:

Having the same warnings. Any updates on the release??


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/react-dnd/react-dnd/issues/731#issuecomment-301677401,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAG7iJxtdBGF1xilTj6uDqFweB0kpqN6ks5r6TBrgaJpZM4M4iok
.

I'm having the warning with the last version: @kadira/[email protected]
Tested on a fresh project just to make sure it was not coming from my code.

For future travelers, it looks like this was done in https://github.com/react-dnd/react-dnd/pull/729, and released in 2.4.0.

Was this page helpful?
0 / 5 - 0 ratings