Skip to content

Instantly share code, notes, and snippets.

@delacruz-dev
Created August 27, 2016 06:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delacruz-dev/27ced152785c3aefdc37fb7259fd896f to your computer and use it in GitHub Desktop.
Save delacruz-dev/27ced152785c3aefdc37fb7259fd896f to your computer and use it in GitHub Desktop.
This webpack configuration resolves the warning of having two different instances of React when working with npm linked modules which has React themselves as a dependency
{
resolve: {
alias: {
react: path.resolve('./node_modules/react')
}
}
}
@delacruz-dev
Copy link
Author

This webpack configuration resolves the warning of having two different instances of React when working with npm linked modules which has React themselves as a dependency.

Add this in your parent component's webpack config and you'll force npm to resolve react in its own node_modules folder.
Kudos: http://stackoverflow.com/questions/31169760/how-to-avoid-react-loading-twice-with-webpack-when-developing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment