I use react-router-dom for routing in my React application. Part of my app extracted in another package. List of dependencies looks like this:
I got this during testing my component which linked to the project (using npm link) and because of that react-router-dom loaded more than once, following solution works in my case:
Inside webpack.config.js I added:
resolve: {
alias: {
'react-router-dom': path.resolve('./node_modules/react-router-dom')
}
}