AndrewHenderson
AndrewHenderson

Reputation: 4972

What do you lose by ejecting a React app that was created using create-react-app?

I'm interested in using Hot Module Replacement with a newly created React app.

Facebook Incubator's create-react-app uses Webpack 2 which can be configured to support HMR, however in order to do so, one needs to "eject" the create-react-app project.

As the documentation points out, this is a "one way" operation and cannot be reversed.

If I'm to do this, I want to know what I might be giving up. I've been unable to locate any documentation that explains the potential drawbacks of ejecting.

Upvotes: 18

Views: 3187

Answers (1)

dwww
dwww

Reputation: 5638

The current configuration allows your project to get updates from create-react-app core team. Once you eject you no longer get this.

It's kind of like pulling in bootstrap css via CDN as opposed to downloading the source code and injecting it directly into your project.

If you want more control over your webpack, there are ways to configure/customize it without ejecting: https://www.npmjs.com/package/custom-react-scripts

Upvotes: 19

Related Questions