react-beautiful-dnd
react-beautiful-dnd copied to clipboard
Unable to install w/react 18
I'm attempting to install this onto a React 18 application. From what I've read in the other issues is that it should install, but not function properly in strict mode. So I pulled out the strict mode and attempted to install, but instead got this:
`npm install react-beautiful-dnd@latest
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"^18.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.5 || ^17.0.0" from [email protected]
npm ERR! node_modules/react-beautiful-dnd
npm ERR! react-beautiful-dnd@"13.1.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.`
Seems to me that it's mad that I'm using React 18. Any workarounds? Or is this just deprecated?
I'm having the same problem, even with react forked lib..
I was having the same issue. One work around I found was to use "npm install --save react-beautiful-dnd --legacy-peer-deps" instead.
Basically npm will ignore the version dependency that the lib has with react 16. It's not ideal, but will install it
I am using more than React 18 and npm 8 versions. The above problems are occurring, and you can consider using a lower version of npm and yarn temporarily.
The answer is that this library supports React 18 version, but I have one question.
Why is there a react on peerDependencies?
Is there a big problem with dependencies? Is there a problem with node_modules capacity increasing exponentially?
I had the same issue. Downgraded to react 17 and it worked. Unless you're using React Suspense, Server components or any other React 18 features, this should work just fine. package.json
"react": "^17.0.2",
"react-dom": "^17.0.2",
same
Don't think downgrading React or ignoring the dependencies is a good way. When you run npm update later on, you'll face this again...
I'm having the same issue after the upgrade to React 18.
same issue
same issue
I was having the same issue. One work around I found was to use "npm install --save react-beautiful-dnd --legacy-peer-deps" instead.
Basically npm will ignore the version dependency that the lib has with react 16. It's not ideal, but will install it
Wont work for typescript
I made it work by switching to ReactDom.render method, instead of new ReactDom.createRoot api. This way you can still use DnD with react 18 and StrictMode.
I was having the same issue. One work around I found was to use "npm install --save react-beautiful-dnd --legacy-peer-deps" instead.
Basically npm will ignore the version dependency that the lib has with react 16. It's not ideal, but will install it
I followed the above instruction and it works fine
npm install --save react-beautiful-dnd --legacy-peer-deps worked for us as well
There's a workaround here: https://github.com/atlassian/react-beautiful-dnd/issues/2399#issuecomment-1167427762
🎉 @hello-pangea/dnd now supports React 18 and react strict mode!
npm install @hello-pangea/dnd- Replace all imports of
react-beautiful-dndwith@hello-pangea/dnd - Enjoy :)
@Xhale1 Thank you!! This is a great package. I am thankful for your choosing to continue to support the critical up-keep. - E
Hey folks, have accepted this PR, closing this issue now. Will cut a release of RBD today
https://github.com/atlassian/react-beautiful-dnd/pull/2429
🎉 @hello-pangea/dnd now supports React 18 and react strict mode!
npm install @hello-pangea/dnd- Replace all imports of
react-beautiful-dndwith@hello-pangea/dnd- Enjoy :)
Worked on TS. Nice. Thanks👍