This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
If you are developing a production application, we recommend using TypeScript and enable type-aware lint rules. Check out the TS template to integrate TypeScript and typescript-eslint
in your project.
This project uses environment variables for configuration. To set up your environment:
- Create a
.env
file in the root directory of the project (already done) - Add your environment variables using the
VITE_
prefix for client-side code:
VITE_REPO_NAME=your-repo-name
react-router-not-working-with-github-pages
When deploying a React application with React Router to GitHub Pages, you might encounter routing issues where refreshing pages or directly accessing URLs results in 404 errors. This happens because GitHub Pages doesn't support client-side routing by default.
Don't forget to update the /blog/posts-in-html/ string in fetchPostContentFromFile to match the actual repo name.