React-dnd: Example breaks down, because React 16 have no `react/lib/*`

Created on 27 Sep 2017  ·  5Comments  ·  Source: react-dnd/react-dnd

This example import update from react/lib/.

But in react 16 blog post:

There is no react/lib/* and react-dom/lib/* anymore

Most helpful comment

Yeah, my bad. That should be fixed in master now

All 5 comments

Yeah, my bad. That should be fixed in master now

Sorry, so what's the solution for this? Do I have to use https://www.npmjs.com/package/react-addons-update or is there another way of doing it? I had a look at the example but I couldn't find it. Thanks in advance!

For those who are upgrading from React 15 to React 16, used one of the deprecated examples in their code and end up here looking for help. The solution is simply to replace:
import update from 'react/lib/update'; with import update from 'immutability-helper';

USING
"ajv": "^6.5.3", "react": "^16.5.2", "react-dnd": "^5.0.0", "react-dnd-html5-backend": "^5.0.1", "react-dom": "^16.5.2", "react-scripts": "1.1.5"

However
import update from 'immutability-helper';
does no longer work

had to install new package. if there's a better way to fix it, I would love to know. thanks
https://stackoverflow.com/questions/41677407/react-lib-update-multiple-splices-multiple-indexes

Was this page helpful?
0 / 5 - 0 ratings