npm / @vitejs/plugin-react
@vitejs/plugin-react
What changed in @vitejs/plugin-react 5 to 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
8 breaking2 deprecations5 new APIs and options1 performance1 behavior and defaults5 tooling9 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@vitejs/plugin-react 619 changes
Breaking changes 3
The option works with oxc-transform-react >= 0.148; using the compiler option requires oxc-transform-react >= 0.152 as a peer dependency.
The plugin no longer provides Babel-related features, including the babel configuration option; use @rolldown/plugin-babel for Babel transforms.
Vite 7 and below are no longer supported; projects using Vite 7 should upgrade to Vite 8.
Deprecations 1
The option is deprecated; use the builtin compiler.reportDiagnostics instead.
New APIs and options 4
Adds an option to skip fast refresh for certain files that won't run in the browser.
Recoverable React Compiler diagnostics are no longer logged by default; set this option to true to log them through Vite.
Enables experimental native React Compiler support when set to true; install oxc-transform-react to use it.
React compiler users can use this preset with @rolldown/plugin-babel for easier setup and a preconfigured filter to improve build performance.
Performance 1
The filter is now linear, avoiding the performance regression caused by the non-linear filter in v6.0.3.
Tooling 3
Expands the peer dependency version range from
^0.152.0to>=0.152.0 <0.157.0.Expands the peer dependency version range from
^0.1.7 || ^0.2.0to^0.1.7 || ^0.2.0 || ^0.3.0.The peer dependency range now includes ^0.2.0, allowing projects using that version to satisfy the peer dependency.
Fixes and other changes 7
The preset now refers to its Babel preset by module path instead of by function, allowing it to be sent to worker threads when using @rolldown/plugin-babel's parallel option.
Fixed the option not working.
Adding or removing a component from a compound component now triggers HMR invalidation on the file and propagates it to importers, preventing stale updates.
With the compiler enabled, TS files no longer trigger Fast Refresh, avoiding runtime errors.
The React Compiler transform now uses the environment sourcemap option instead of the top-level option when builder.sharedPlugins is enabled.
Fixed the
$RefreshSig$ is not definederror when runningvite devwithNODE_ENV=production.The type now allows all options for reactCompilerPreset, rather than only compilationMode and target.
@vitejs/plugin-react 512 changes
Breaking changes 5
The plugin now uses optimizeDeps.rolldownOptions to support newer rolldown-vite; update rolldown-vite if using an older version.
The disableOxcRecommendation option has been removed.
The plugin now requires Node 20.19+ or 22.12+.
The plugin no longer automatically adds react and react-dom to resolve.dedupe; add them manually to retain the previous behavior.
Support for the old babel-plugin-react-compiler setup that requires runtimeModule has been removed; use a newer compiler version that supports target.
Deprecations 1
The package is deprecated because its Oxc React refresh transform behavior is now provided by this plugin.
New APIs and options 1
SSR applications can import this virtual module at the top of their client entry to initialize the HMR runtime instead of manually calling transformIndexHtml.
Behavior and default changes 1
For NODE_ENV=development builds, the plugin uses the development JSX transform rather than the production JSX transform.
Tooling 2
The plugin is compatible with Vite 8, which is added to its peerDependencies range.
When used with rolldown-vite, the plugin now uses Oxc for the React refresh transform.
Fixes and other changes 2
Babel is no longer incorrectly skipped when babel.overrides is configured without top-level plugins or presets, so override configurations are processed.
The plugin now uses the transform.jsx option to support raw Rolldown 1.0.0-beta.44+, which removed the top-level jsx option.