Creating a React App with Vite | React Crash Course #01

Posted by

React Crash Course | #01 – Creating a React App (using Vite)

React Crash Course | #01 – Creating a React App (using Vite)

Welcome to the first installment of our React Crash Course series! In this tutorial, we will walk you through the process of creating a React app using Vite, a next-generation build tool that provides a fast and reliable development experience.

What is Vite?

Vite is a build tool that aims to provide a blazing fast development experience for modern web development. It leverages native ES Module support in modern browsers to serve JavaScript and CSS files directly, without bundling them into a single file during development. This results in significantly faster build times and an improved development experience.

Getting Started

Before we get started, make sure you have Node.js and npm installed on your machine. You can install Vite globally by running the following command:

npm install -g create-vite

Once Vite is installed, you can create a new React app by running the following command:

npx create-vite@latest my-react-app --template react

This command will create a new directory called “my-react-app” and scaffolds a new React app using Vite as the build tool.

Running the App

Navigate to the newly created directory and run the following command to start the development server:

cd my-react-app
npm run dev

This will start the development server and open your new React app in the browser. You can now start developing your app and see your changes live as you make them.

Conclusion

And that’s it! You’ve successfully created a new React app using Vite. In the next installment of our React Crash Course series, we will dive deeper into building components, managing state, and working with data in React. Stay tuned!

0 0 votes
Article Rating
31 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@markjasonquibuyen6221
6 months ago

(node:29928) Warning: An error event has already been emitted on the socket. Please use the destroy method on the socket while handling a 'clientError' event 🙁 how to fix sir

@flyingpotato3593
6 months ago

Hello po, Hingi lang advice sir kase.front-end dev ako pero halos PSD to HTML CSS/bootstrap and Jquery gamit ko. mostly pa ng picture e chatgpt at copy paste sa google. parang hirap kase ko gumawa ng sariling function kahit anung tutorial at practice ko pero naiintindihan ko naman pano gumagana kase naeedit ko. Okay lang po kaya tumalon sa React.js ? Na-stack na po kase ko sa company ko na old school gamit. Nag try na din kase ko mag apply apply kaso puro Framework na ngayon need.

@JM-fd5dh
6 months ago

May gc group po ba tau here ? Thank you

@JM-fd5dh
6 months ago

Dito nainstall hahah sabi 'the term npm is not recognize' po

@user-sp6nl2sm5p
6 months ago

failed to load config from C: …
even though my node version is up to date

@TheSanawman
6 months ago

Lods, I built a website for a client using Vite. Kapag 'open in new tab' yung link nage-error 404. Same din kapag nagclick to an external link then back, error 404 na. Help!!!!!

@user-lw2qu8vk6j
6 months ago

ask lng po, bat ayaw ma install thru Windows?
salamat…😁

@m4rkbello
6 months ago

witwit

@pabs3892
6 months ago

sir ganto lumalabas saakin pag iinstall ko sya

npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file,

or operable program. Check the spelling of the name, or if a path was included, verify

that the path is correct and try again.

At line:1 char:1

+ npm create vite@latest

+ ~~~

+ CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException

+ FullyQualifiedErrorId : CommandNotFoundException

@ChloeRaina
6 months ago

pano po i-access yung existing project? or halimbawa may multiple projects ka pipili ka ng isa

@aror9574
6 months ago

request po onsite search for website hehe

@artzrasr4363
6 months ago

Nice thank you meron pala nito😍😍

@kenxinhxc1635
6 months ago

sa wakas dito na ko hahaha

@goodgirl9484
6 months ago

bakit po saakin kapag after ko i-enter ang 'npm install' may lumalabas na '5 moderate severity vulnerabilities'? ignore ko lang po ba to?

@haaachi6989
6 months ago

Hehehe, natapos ko na yung isang series, pwede na mag proceed sa react. Thank you po!!

@jerald1836
6 months ago

wow, nag start akong mag aral ng web dev specially sa React, kaso puro english lang nasa youtube, ito mas maganda dahil tagalog. Hope marami kapang matulungoan…

@2408heineken
6 months ago

hehe sir salamat. nainspire ako ulit mag code 🥹 then this will give us a lot of opportunities for career growth

@adsj1999
6 months ago

career shifter po, sana may css, js and html huhu thanks po.

@kennethcayetano2861
6 months ago

Thank you po for this. Looking forward to more videos. Currently working as a laravel developer, will try to learn React 😊

@user-qr6dt2mw3v
6 months ago

laking help po nito sir. More video pa po.