DEV Community

Discussion on: How to modify config of Create React App - without Ejecting!

Collapse
 
anandharshan profile image
Anand Harshan

Could you please elaborate on how to do

Update the library to list React as a peer dependency and then update the bundler (rollup) to not include React in the bundle.

Collapse
 
kildareflare profile image
Rich Field

In the library I updated the package.json, moving React from dependencies to peerDependencies
E.g.

  "peerDependencies": {
    "react": "^16.12.0"
  }
Enter fullscreen mode Exit fullscreen mode