Q1. Where can you deploy a React app?
You can deploy to static hosting services like Netlify, Vercel, GitHub Pages, Firebase Hosting, AWS S3, or any web server that can serve static files.
Q2. How do you deploy to Netlify?
Build the app, then drag and drop the build folder to Netlify Drop, or connect your Git repository for continuous deployment. Netlify automatically runs build commands.
Q3. How do you deploy to GitHub Pages?
Install gh-pages package, add homepage to package.json, and scripts: "predeploy": "npm run build", "deploy": "gh-pages -d build". Then run npm run deploy.
Q4. What is the importance of the 200.html or _redirects file?
For single-page apps, you need to ensure that all routes fallback to index.html. Many hosts allow you to set up redirects. For example, Netlify uses _redirects, while others use configuration files.
Q5. How do you handle environment variables in deployment?
Set them in your hosting platform's dashboard or in build commands. For example, in Netlify, you can set environment variables in site settings. They will be injected during build.
