Goodbye create-react-app
Abhigyan Gautam
Posted on March 21, 2023
React developer team recently removed create-react-app
from the official documentation. This means it is no longer the default method of setting up a new project in React. According to this pull request on Github, create-react-app
is finally gone.
The problem with CRA
For far too long,create-react-app
or CRA has had problems with its performance. It is slow and bulky compared to the modern methods. The initial setup is quite bulky as there are a lot of dependencies to be installed. It also is outdated as the dependencies themselves suffer from warnings during installation. These problems have troubled developers for far too long. Since CRA was the officially supported way, beginners had a hard time solving these issues.
What are the alternatives?
There are various ways to setup a new React project. In fact, the official documentation now mentions frameworks like NEXT-JS, Remix etc for beginners. In this post however, we will look into using Vite to setup our React app in under a minute.
Why Vite?
Vite is one of the fastest ways to start a project in react. It has faster server start time. It has better compatibility with plugins. It supports TypeScript, has better dependency resolving features out of the box. React projects created from Vite are just 20% the size of that created by CRA. You can read more about Vite here
Creating a new React project using Vite
Let's create a new React project using Vite. Run the following in the folder where you want your new app.
npm create vite@latest
Name your project and select React from the type of project. Next select variant, here we are using JavaScript.
And it is done! Seriously, that's it. All of this takes less than a minute to setup.
You can now run the app using
cd <project-root>
npm i
npm run dev
Your app is up and running
Congratulations!🎉🎉
Posted on March 21, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.