DEV Community

Cover image for Stop Using Create-React-App!
Hardik Mirg
Hardik Mirg

Posted on

Stop Using Create-React-App!

STOP USING CREATE-REACT-APP, USE THIS INSTEAD~

Every React Developer starting its react journey starts either with The React.js Documentation or with YouTube Tutorials.

The problem with that is both of them teach us to initialize our app with Create-react-app, or CRA for short.

Now, You might think, what's wrong with that?

Well, The actual problem with CRA is that it's too good!
A better way to say it will be, "It's just not for beginners"

CRA provides a bunch of tools not required for basic applications, which surely makes it overwhelming for beginners and makes our app slow in various ways.

Due to the excessive amount of libraries required by CRA, It takes a lot longer bundling time than VITE!

Vite makes it a lot easier for developers.

It doesn't require excessive libraries, making the bundling time drop at a significant rate!

It supports HMR, which is extremely useful for developing state based react components.

An insane feature that makes Vite faster than any bundling tool out there is that in a React app, instead of bundling our app and then sending it to the browser, it loads our raw JSX or TSX files!

CRA is not even close when compared to speed tests.

To get started with Vite JS, open a new Terminal Window and make sure you have NodeJS installed.

npm init vite

Enter your project's name and select the framework of your choice.
You can even choose between JS and TS.

And just like that, your React projects it set up literally under 5 seconds!

Just CD into your folder and install the necessary dependencies using npm i or npm install

Use npm run dev to start your local development server!

Or, to do all that quickly, just run:

cd <project-name> && npm i && npm run dev

JUST VISIT http://localhost:3000 AND HERE YOU GO!

Image description


Congrats! Now you can develop your React apps faster than ever!

Hope you learnt something useful today, See you later!

Top comments (1)

Collapse
 
pcelac profile image
Aleks

It's really fast, but not production ready unfortunately.
I have experienced too many problems with libraries while trying to migrate from CRA.