React project ကို local computer မှာ စတင်ဖို့ Vite ကိုသုံးတာ အလွယ်ဆုံးနည်းလမ်းတွေထဲက တစ်ခုပါ။ Vite က development server ကိုမြန်မြန်ဖွင့်ပေးပြီး React project folder structure ကိုလည်း သန့်သန့်ရှင်းရှင်း စတင်ပေးပါတယ်။
jsx
# 1. Create a React project with Vite
npm create vite@latest my-react-app -- --template react
# 2. Move into the project folder
cd my-react-app
# 3. Install project dependencies
npm install
# 4. Start the local development server
npm run devပထမ command က React template ပါတဲ့ Vite project တစ်ခုဆောက်ပါတယ်။ `cd` က project folder ထဲဝင်တာ၊ `npm install` ကလိုအပ်တဲ့ packages တွေထည့်တာ၊ `npm run dev` က local preview server ဖွင့်တာပါ။
You should see
Terminal မှာ `Local: http://localhost:5173/` လို URL ပေါ်လာပြီး browser မှာ React starter page ကိုကြည့်နိုင်မယ်။Info
React code ကို အများအားဖြင့် `src/App.jsx` မှာစပြီးစမ်းနိုင်ပါတယ်။ အပြောင်းအလဲလုပ်ပြီး save လိုက်တာနဲ့ browser မှာ auto refresh ဖြစ်ပါလိမ့်မယ်။