steos / reactcards

devcards for react
BSD 3-Clause "New" or "Revised" License
486 stars 29 forks source link

Change react and react-dom to externals in webpack and peer dependencies in package.json #34

Closed ChrisMLee closed 7 years ago

ChrisMLee commented 7 years ago

Under the current version of reactcards, any components that use refs will cause the following error Uncaught Error: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded. This is due to the fact that the library uses its own internal versions of react and react-dom, causing a collision. By changing these to externals and peer dependencies, we allow the library to access whatever versions the user currently has installed in node_modules averting this error.