Plugin React
@vitejs/plugin-react
The default Vite plugin for React projects
Utilities
fast refresh
react
react-refresh
vite
vite-plugin
@vitejs/plugin-react
Utilities
javascript
npm
frontend
Stars
1.2k
Weekly
60M
Open issues
111
Bundle
~15 kB
Installation
npm install @vitejs/plugin-reactCode example
import { usePluginReact } from "@vitejs/plugin-react";
export function Example() {
const value = usePluginReact();
return <p>{String(value)}</p>;
}Pros & cons
Pros
- Actively maintained by Evan You
- 60M weekly downloads. Battle tested
- MIT licensed
Considerations
- Adds roughly ~15 kB to your bundle
- Needs client-only rendering in SSR frameworks
- Not supported in React Native
- 111 open issues on GitHub