Goodbye create-react-app (2024)

Abhigyan Gautam

Posted on

Goodbye create-react-app (3) Goodbye create-react-app (4) Goodbye create-react-app (5) Goodbye create-react-app (6) Goodbye create-react-app (7)

#react #createreactapp #vite

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

Goodbye create-react-app (8)

Name your project and select React from the type of project. Next select variant, here we are using JavaScript.

Goodbye create-react-app (9)

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 inpm run dev

Your app is up and running

Goodbye create-react-app (10)

Congratulations!🎉🎉

Top comments (12)

Subscribe

Nayden Gochev

Nayden Gochev

Java Professional with full-stack competence;Consultant; Contractor; Speaker; Co-founder of jPrime Conference;Founder of jProfessional conferences;Founder of java.beer events;

  • Location

    Bulgarian

  • Education

    Masters Degrees in Computer Science

  • Work

    Superhero with Java powers !

  • Joined

Mar 24 '23

  • Copy link

Why it uses NPM and not NPX ?

npm is only for packages not for project creations, npx is for executions.

P.S. Not a JavaScript developer here really I am asking since this was my understanding.

Not really sure, but I think since Vite just creates a standard project structure using npm. However, you can still use npx to create project structures based on templates. Look up community templates

fromaus

fromaus

  • Joined

Apr 24 '23 • Edited on Apr 24 • Edited

  • Copy link

It does use npx behind the scenes I think.

So npm create xxx actually runs:

npx create-xxx

So in NPM there will be a package named create-vite and this is what gets executed.

Similarly, the command for scaffolding a new Next.js app in the Next.js quickstart is npx create-next-app@latest. This can instead be run as: npm create next-app@latest (I suppose @latest can be omitted).

By the way npm create is just a synonym for npm init that we routine use to scaffold a blank Node app. So by saying npm create vite we are just passing the name of package create-vite to npm init to use as the scaffolder instead of the default scaffolding logic.

Tomas Bruckner

Tomas Bruckner

  • Joined

Mar 23 '23

  • Copy link

Vite has high chance of not working in production with React github.com/vitejs/vite/issues/2139

Abhigyan Gautam

Abhigyan Gautam

  • Joined

Mar 27 '23

  • Copy link

Thanks for pointing this out. I agree that Vite is still not 100% replacement for CRA, but is better in all aspects. Plus the official documentation now mentions frameworks like Next.JS as the starting point

Budy

Mar 23 '23

  • Copy link

woow,,,that is a serious bug

Daniel Musembi

Daniel Musembi

Full Stack (MERN)/ React-Native developer. I want to help other developers avoid some of the same challenges I faced while developing various features.

  • Email

    danielmusembi20@gmail.com

  • Location

    Kenya

  • Education

    Murang'a University, Kenya

  • Work

    Developer, Technical Writer

  • Joined

Mar 23 '23

  • Copy link

Thank you alot

lionel-rowe

lionel-rowe

  • Joined

Mar 22 '23

  • Copy link

Though I never knew you at all
You had the grace to hold yourself
While those around you crawled

Josiah

Josiah

  • Joined

Mar 30 '23

  • Copy link

My team and I Ran into quite a few issues with authorization sessions/cookies in vite. Tried again in create-react-app and had no issues with it whatsoever. Not sure how I feel about either but I'm not commited to one or the other

fromaus

fromaus

  • Joined

Apr 24 '23 • Edited on Apr 24 • Edited

  • Copy link

Vite is only good for learning IMO. The last time I checked, it didn't generate a proper production bundle.

A framework like Next.js on the other hand is entirely about production bells and whistles. So next.js has put tons of work in production webpack config (with code splitting, image optimisation, polyfilling etc all configured for you) which you can customise also and which they keep updated. They also have a really simple CI/CD experience and terrific support for SSR and SSG and for SEO.

In fact even for learning, next.js would be an excellent tool. The scaffold it generates is so simple and minimal that you can scaffold a new app to quickly try something out in React or to follow along with a YouTube tutorial. I think somebody who has build a couple of pages with React by linking the two react scripts directly in script tags and understands the basics of how JSX gets translated into HTML, should be able to follow next.js's excellent Getting Started tutorial.

Given how some it is to get started with Next.js, the only advantage I see with Vite is that it has a faster Dev server. But Next.js Dev server experience isn't slow either. So Vite's Dev server being faster is a moot point IMO.

Richard Carrigan

Richard Carrigan

Microsoft Certified Trainer (MCT) | Azure Administrator | Full-Stack Developer | DevOps Enthusiast | Technical Problem-Solver

  • Location

    Kingston, WA

  • Education

    Mostly self-taught

  • Work

    Technical Program Manager at Microsoft

  • Joined

Sep 14 '23

  • Copy link

The decision to encourage developers new to React to start with a meta-framework like Next.js is...interesting. While I understand that CRA is usually not a good choice for a production app, it is a great choice for learning, as you're only working with React. This takes context issues to a whole new level.

Before, a new dev could confuse a JS issue with a React issue, due to not fully understanding whether they're writing "React code" or "JavaScript code" ATM. But now, new devs will have to try and determine whether they're writing "Next.js code", "React code", or "JavaScript code". And if there's an issue, how could we possibly expect them to file an issue with the right team?

It will be interesting to see where this decision leads...

Pierre-Henry Soria ✨

Pierre-Henry Soria ✨

👋Pierre-Henry. A Passionate Software Engineer😎 I create cool stuff (https://github.com/Lifyzer & https://github.com/pH7Software), love programming, eating fruits, developing & applying new skills 😊

  • Email

    pierre@ph7.me

  • Location

    🌴 Singapore 🥥

  • Education

    James Cook University

  • Work

    Senior Software Engineer at Zambrero 🌯

  • Joined

Nov 7 '23

  • Copy link

Nice read Abhigyan! Personally, I'm a big fan of Vite. This is great news TBH.

For further actions, you may consider blocking this person and/or reporting abuse

Goodbye create-react-app (2024)

FAQs

Is the create-react-app obsolete? ›

In 2023, the Create React App tool was deprecated, which means that it was no longer being maintained. Create React App has been the go-to way to make a new React project, but it's been dethroned by a number of different alternatives.

What is replacing the create-react-app? ›

  • Vite.
  • Next.js.
  • Remix.
  • Gatsby.
  • Astro.
  • Parcel.
  • Nx.
  • T3 Stack. CodeSandbox. StackBlitz.
Feb 21, 2024

Why use vite instead of create-react-app? ›

Vite offers several advantages over CRA, including faster development server startup, reduced waiting times for file updates, and improved build performance. Additionally, Vite's support for native ES modules and its plugin system provide more flexibility and customization options.

Why does create-react-app take so much time? ›

Another reason behind the slow build up time is: The CRA (create-react-app) package uses a webpack, which bundles the entire application code before it can be served. With a large codebase, it takes more time in setting up the server and changes to get reflected (we see increased development and build time).

Is the Create React app abandoned? ›

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.

Why shouldn't I use the Create React app? ›

Not having a scalable structure makes your app slow and increases its rendering time.
  • It is Unmaintained. The create-react-app GitHub repository does not have active maintainers. ...
  • Overdependency on Webpack. ...
  • Lacks Many Features. ...
  • Better Alternatives. ...
  • Vite. ...
  • Server Side Generation. ...
  • Server Side Rendering.
Feb 5, 2023

Why is Nextjs better than Create React App? ›

The major difference between Next JS and React JS is performance. If we talk about Next. js applications, they are extremely fast because of the static destinations and server-side rendering. Of course, they are viable due to many performance enhancement features, such as Image Optimization.

Is there anything better than Vite? ›

Webpack performs better in browser navigation speed due to pre-bundled site data. Both support HMR but have different module-serving mechanisms. Vite manages local and browser caching seamlessly, while Webpack needs custom configuration.

Should I use Gatsby or Create React App? ›

Gatsby excels at search engine optimization (SEOs), where Create React App is lacking, while React excels at dynamic content and interactive application creation where Gatsby won't work at all. The demands of the project should dictate what tool you use and, if needed, you can have both at once.

What are the drawbacks of create-react-app? ›

Disadvantages of Create React App
  1. Lack of customization options. ...
  2. It can be somewhat limiting, especially if there are some tools that CRA doesn't support right away.
  3. Because Create React App only supports CSR and not SSR, it's not enough to ensure your app's higher performance.
Aug 23, 2022

Do I have to create React app for every project? ›

If you are concerned with the size of it, you do not need to run create-react-app every time. You can make a react project yourself quite easily and by doing so you have much more control and understanding of your project. I recommend looking up how to set up a react project from scratch using the MERN stack.

How hard is it to create a React app? ›

Creating a new React application is not a simple task. Not just because you'll have to work hard, but mainly because you have some key decisions to make that will affect your ability to scale, collaborate, and make this app work with the tools and needs you use today — and in the future.

Is create react app bad practice? ›

Create-React-App is not inherently bad for production, but developers must be aware of its limitations and potential security vulnerabilities.

What are the drawbacks of create react app? ›

Disadvantages of Create React App
  1. Lack of customization options. ...
  2. It can be somewhat limiting, especially if there are some tools that CRA doesn't support right away.
  3. Because Create React App only supports CSR and not SSR, it's not enough to ensure your app's higher performance.
Aug 23, 2022

Should I use Nextjs or create react app? ›

React can be the right choice if you wish to build a large complex web application with complex routing and heavily data-driven components. Next. js can be a good choice for you if you wish to build a static website or JAMstack application.

Is create react app bad for SEO? ›

The bottom line. Single-page React applications offer exceptional performance, seamless interactions close to those of native applications, a lighter server payload, and ease of web development. Challenges with SEO shouldn't be a reason for you to avoid using the React library.

Top Articles
England 'healthier than the US'
Why Was I Denied a Checking Account? - Experian
Part time Jobs in El Paso; Texas that pay $15, $25, $30, $40, $50, $60 an hour online
Botw Royal Guard
Nehemiah 4:1–23
Top Scorers Transfermarkt
Coindraw App
Recent Obituaries Patriot Ledger
Blog:Vyond-styled rants -- List of nicknames (blog edition) (TouhouWonder version)
Hair Love Salon Bradley Beach
Studentvue Columbia Heights
Panorama Charter Portal
065106619
History of Osceola County
Milspec Mojo Bio
Farmer's Almanac 2 Month Free Forecast
2020 Military Pay Charts – Officer & Enlisted Pay Scales (3.1% Raise)
Lista trofeów | Jedi Upadły Zakon / Fallen Order - Star Wars Jedi Fallen Order - poradnik do gry | GRYOnline.pl
Music Go Round Music Store
Selfservice Bright Lending
Graphic Look Inside Jeffrey Dahmer
Somewhere In Queens Showtimes Near The Maple Theater
Canvasdiscount Black Friday Deals
Magic Seaweed Daytona
SN100C, An Australia Trademark of Nihon Superior Co., Ltd.. Application Number: 2480607 :: Trademark Elite Trademarks
Project Reeducation Gamcore
3 Ways to Drive Employee Engagement with Recognition Programs | UKG
Mcclendon's Near Me
Weather October 15
Elijah Streams Videos
Nurtsug
Club Keno Drawings
Warn Notice Va
Syracuse Jr High Home Page
Bursar.okstate.edu
Ourhotwifes
Compress PDF - quick, online, free
Tenant Vs. Occupant: Is There Really A Difference Between Them?
Chuze Fitness La Verne Reviews
Otter Bustr
The Vélodrome d'Hiver (Vél d'Hiv) Roundup
Mid America Clinical Labs Appointments
11 Best Hotels in Cologne (Köln), Germany in 2024 - My Germany Vacation
Sacramentocraiglist
6463896344
Germany’s intensely private and immensely wealthy Reimann family
Hcs Smartfind
Honeybee: Classification, Morphology, Types, and Lifecycle
Affidea ExpressCare - Affidea Ireland
Latest Posts
Article information

Author: Jonah Leffler

Last Updated:

Views: 6622

Rating: 4.4 / 5 (45 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Jonah Leffler

Birthday: 1997-10-27

Address: 8987 Kieth Ports, Luettgenland, CT 54657-9808

Phone: +2611128251586

Job: Mining Supervisor

Hobby: Worldbuilding, Electronics, Amateur radio, Skiing, Cycling, Jogging, Taxidermy

Introduction: My name is Jonah Leffler, I am a determined, faithful, outstanding, inexpensive, cheerful, determined, smiling person who loves writing and wants to share my knowledge and understanding with you.