For reusable components:
- Put a
reactdependency in both
- Never put a
peerDependencies specifies which version(s) of React your reusable component supports/requires. When using npm 2 this also adds React to the list of modules to be installed, but this is no longer the case with npm 3.
devDependencies ensures React will be installed when you run
npm install while developing your component, or when running tests on Travis or similar.
dependencies will cause multiple versions of React to be installed if somebody uses your component but has a different version of React in their own
package.json – having multiple versions of React not only bloats the build, but also causes errors when different versions try to interact.