Vite helps you easily set up and build your React app locally. It takes care of all the transpiling and bundling you would have otherwise needed other apps to do. Under the hood, Vite uses esbuild which gives you a faster response time in setting up an app.
Assuming that you’ve already installed Node.js and NPM on your machine (check in Terminal using node -v and npm -v, which should return the latest version you’re on)
Project setup (in Terminal)
npm create vite@latest- Add project name
- Select React
- Select React (without typescript)
- Follow instructions to type in
cd vite-react,npm install,npm run dev
You can access your project through the local link it spits out for you in a browser, in this case, http://localhost:3000/
Strict mode
- Components render twice to make sure they render consistently over time