react-images-upload icon indicating copy to clipboard operation
react-images-upload copied to clipboard

Set react and react-dom as peer dependencies

Open watery opened this issue 5 years ago • 1 comments

I'm splitting a monolithic React application in components to later be able to reuse them.

When I began moving files and folders around and changing imports, I seldom hit a runtime error which, among other reasons, stated "You might have mismatching versions of React and the renderer (such as React DOM)".

I found that some of my components listed react and react-dom as dependencies and so did the main application, ending up with two copies of that package. After moving my components react-* dependencies to peerDependencies that error went away and the application ran fine.

I just got that error again, in a specific page that makes use of this package.

I manually edited this package package.json in my local node_modules folder to set those as peerDependencies and that fixed the error.

I guess they can be safely moved to peerDependencies: what do you think?

watery avatar Mar 13 '20 11:03 watery

HI @JakeHartnell, may I get an update on this?

watery avatar Nov 03 '20 09:11 watery