What Does Eject do in Create React App?

18,013

To bootstrap a react project it will require for you to know about things like Webpack or Babel which might be a sticking point for people who do not want to learn about these.

create-react-app provides a fully configured environment with reasonable defaults (and possible to extend). Most infrastructure-related work is hidden from you, and whenever there are changes in one of the dependent packages this is taken care of for you -- it will only be required to update react-scripts.

I highly recommend this presentation by one of CRA authors it will give you a better idea of the project.

Now eject means that all of the configuration will be exposed to you. You will see every package which runs your project. Now you are responsible for maintaining all of that configuration.

This is not necessarily a bad thing; you are then left with more code to maintain, but you get full control in return.

Share:
18,013
Shai UI
Author by

Shai UI

front-end developer in finance. especially html5/javascript/css based apps for mobile/desktop/tablets, node.js on the back-end. my main interests are heavy GUI, 2d/3d, data visualizations. check out my youtube channel: https://www.youtube.com/channel/UCJagBFh6ClHpZ2_EI5a3WlQ

Updated on June 06, 2022

Comments

  • Shai UI
    Shai UI almost 2 years

    I think it has something to do with using webpack directly and therefore gives more flexibility. But I'm not completely sure if someone can explain what "ejecting" means. Also what are the ramifications of ejecting a create react app? Is it bad to do this, or?

  • nnyby
    nnyby about 6 years
    Yeah, I've found the eject command to be really useful. It allowed me to customize the dev and build targets on my own (these will be created in the config directory of your project). Here's an example of a react app initially created with create-react-app and then ejected: github.com/ccnmtl/econplayground.js
  • goonerify
    goonerify over 4 years
    If you're interested in watching the above presentation by Dan Abramov - one of the authors of CRA - but don't want to watch the whole thing, you can skip to the part about ejecting CRA and using "toolboxes": youtu.be/G39lKaONAlA?t=1336