React Deployment
Deploy your React app to production platforms.
Deploy your React app to production.
Build for Production
```bash npm run build ```
Creates optimized production build in `build/` folder.
Vercel Deployment
1. Install Vercel CLI: ```bash npm i -g vercel ```
2. Deploy: ```bash vercel ```
Netlify Deployment
1. Install Netlify CLI: ```bash npm i -g netlify-cli ```
2. Deploy: ```bash netlify deploy --prod ```
GitHub Pages
1. Install gh-pages: ```bash npm i gh-pages ```
2. Add to package.json: ```json { "homepage": "https://username.github.io/repo-name", "scripts": { "deploy": "gh-pages -d build" } } ```
3. Deploy: ```bash npm run deploy ```
Environment Variables
Set in platform settings: - Vercel: Project Settings → Environment Variables - Netlify: Site Settings → Build & deploy → Environment
Remember
- Build before deploying - Set environment variables - Test production build locally - Use HTTPS in production
> Next: Learn forms with libraries!