Home > Software engineering >  Stick with ejected create-react-app or setup react from scratch?
Stick with ejected create-react-app or setup react from scratch?

Time:09-21

I'm currently building a web app for my company. We're building it with react and in an effort to get the POC off the ground quickly, I used create-react-app, which I have since ejected.

I'm now considering moving to a "from-scratch" implementation and setting up webpack on my own to have complete control of it.

Should I do this or stick with the ejected create react app? Looking for any thoughts or experiences at all.

We're building this to be a fully fledged PWA, the irritation in digging through the docs on how to get the service-worker setup in the way create-react-app wants prompted this question.

CodePudding user response:

It'll be hard to answer this question because it all depends, it depends how much non standard changes You'll have to make in ejected webpack config and how much time you want to spend on creating and maintaining new one. From my past experience in Angular and React ejecting webpack always ended up with massive hacks, it was caused by working in team of people with different level of expertise who wanted to quickly change config to solve their current problem, it always happens when project grows and is maintained by different people for many years.

So basically my advice would be to stay as close to non ejected config and standard solutions as possible because it tends to produce more issues than benefits, even if created with great care at the beginning.

CodePudding user response:

I agree with Dariusz, it depends on your usecase. Starting off, people tend to stick with the boilerplate (create-react-app), and then as their needs become more custom, they eject.

I ran into a case fairly recently where I needed to make some minor changes to the WP config and didn't want to deal with ejecting. After some research I came across the craco module, and it worked out perfectly. Allowed me to customize what I wanted, without ejecting.

  • Related