javascript - symlink causing 2 versions of react -


i have project bunch of sub custom npm modules being loaded in - work in submodules publish them private npm repository , pull them main platform of project use. speed dev time, have been symlinking sub module's dist (transpiled publish) folder main project building. other modules, has been ok, current module seems loading 2 copies of react. clear, error message:

bundle.js:29585 uncaught (in promise) error: removecomponentasreffrom(...): reactowner can have refs. might removing ref component not created inside component's render method, or have multiple copies of react loaded

what confusing doing npm ls react shows me this:

  └── react@15.3.0 

so looks there 1 version. also, if delete symlink , npm module private repo (with exact same code), not have error. main platform , sub repo both have react dep, have done method other sub repos have react dep , have had no issues before. using webpack bundle well, don't know if part of issue.

has run this? not sure how approach this, advice appreciated. thanks!

related discussion: how avoid `loaded 2 copies of react` error when developing external component?

previously have had success resolving react , react-dom in webpack configuration avoid loading multiple copies.

resolve: {   alias: {     react: path.join('./node_modules', 'react'),     'react-dom': path.join('./node_modules', 'react-dom')   } } 

Comments

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -