useTheme's initial state now always renders 'light' on both server and client's first render pass, matching exactly. The real stored/OS-preferred theme is applied afterward in an effect (runs only post-hydration), instead of computing it during the initializer, which returned different values between the server (no window) and a client whose actual localStorage/ matchMedia preference differed from the SSR default (e.g. dark-mode OS or a stored 'dark' preference) — a real hydration mismatch on the ThemeToggle's rendered icon and aria-pressed attribute, intermittent per visitor/system.
React + Vite
This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the Oxlint configuration
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and Oxlint's TypeScript related rules in your project.