We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
react-dom
optimizeOps
1 parent 7a7e339 commit e8a923fCopy full SHA for e8a923f
packages/plugin-react/src/index.ts
@@ -269,10 +269,12 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
269
},
270
}
271
272
- // We can't add `react-dom` because the dependency is `react-dom/client`
273
- // for React 18 while it's `react-dom` for React 17. We'd need to detect
274
- // what React version the user has installed.
275
- const dependencies = ['react', jsxImportDevRuntime, jsxImportRuntime]
+ const dependencies = [
+ 'react',
+ 'react-dom',
+ jsxImportDevRuntime,
276
+ jsxImportRuntime,
277
+ ]
278
const staticBabelPlugins =
279
typeof opts.babel === 'object' ? opts.babel?.plugins ?? [] : []
280
const reactCompilerPlugin = getReactCompilerPlugin(staticBabelPlugins)
0 commit comments