PL

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
0
Open issues
102
Bundle
~60 kB

Installation

npm install @vitejs/plugin-react

Code 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
  • 0 weekly downloads. Battle tested
  • MIT licensed

Considerations

  • Adds roughly ~60 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 102 open issues on GitHub

FAQs

Alternatives & similar libraries