Create React App doesn’t allow you to build “fully with React” 😭
If you’ve ever used Create React App to start a new React project, you might have run into the frustration of not being able to build your app “fully with React.” This can be a major pain point for developers who want complete control over their code and build process. In this article, we’ll explore why Create React App falls short in this regard and how you can overcome its limitations.
Why Create React App falls short
Create React App is a great tool for quickly setting up a new React project. It provides a lot of boilerplate code and configuration out of the box, which can save you a ton of time. However, it also comes with some limitations that can be frustrating for more advanced developers.
One of the biggest limitations of Create React App is its lack of configurability. The build process is abstracted away behind a black box, so you have little control over how your code is bundled, optimized, and delivered to the browser. This can be a major headache if you have specific optimization requirements or need to integrate with custom build tools.
How to overcome these limitations
Despite its limitations, Create React App can still be a useful starting point for your projects. However, if you find yourself needing more control over the build process, there are a couple of strategies you can pursue:
- Eject from Create React App: This is the most straightforward option, but it comes with some downsides. When you eject, you’ll get access to all of the configuration and scripts that Create React App uses under the hood. This can give you the control you need, but it also means that you’re responsible for managing and updating these configurations yourself.
- Use a custom build setup: If you want to keep the benefits of Create React App without sacrificing control, you might consider setting up a custom build process using tools like Webpack, Babel, and ESLint. This can take more time and effort up front, but it can give you the flexibility to fully customize your build without losing the convenience of Create React App’s initial setup.
Conclusion
Create React App is a great tool for quickly getting started with a new React project, but it does have limitations when it comes to building “fully with React.” If you find yourself needing more control over your build process, consider ejecting from Create React App or setting up a custom build setup. With a bit of extra effort, you can have the best of both worlds: the convenience of Create React App and the control to build your app fully with React.
Hey, if you are migrating from CRA and if you are fine doing that on stream or talking about it on the stream reach out on Twitter!
Chapters:
0:00 hi friend
8:17 is it wrong to use Next.js?
20:07 Dan: we are not scared of Vue or Svelte
32:33 could Astro build a template that is good for React?
38:44 was Vite completely ignored in the new docs?
48:22 be more thoughtful of people using CRA
59:31 CRA is Dead, now what?
1:13:15 how to migrate from CRA