Currently react, react-dom, and react-router-dom are listed as dependencies of this project.
Upon trying to install this package into an existing project and using it, errors are thrown because this package has its own version of react as a dependency.
Replication:
npx create-react-app <project name>
npm install this package
npm ls react you will see 2 version of react, one for the base project and 1 from this package
Moving the dependencies to peerDependencies and devDependencies allows projects to use this package.
Currently
react
,react-dom
, andreact-router-dom
are listed as dependencies of this project.Upon trying to install this package into an existing project and using it, errors are thrown because this package has its own version of react as a dependency.
Replication:
npx create-react-app <project name>
npm install
this packagenpm ls react
you will see 2 version of react, one for the base project and 1 from this packageMoving the dependencies to peerDependencies and devDependencies allows projects to use this package.
https://classic.yarnpkg.com/en/docs/dependency-types/