Update dependency @vitejs/plugin-react to v4.3.0
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
@vitejs/plugin-react (source) | dependencies | minor | 4.2.1 -> 4.3.0 |
Release Notes
vitejs/vite-plugin-react (@vitejs/plugin-react)
v4.3.0
Fix support for React compiler
Don't set retainLines: true
when the React compiler is used. This creates whitespace issues and the compiler is modifying the JSX too much to get correct line numbers after that. If you want to use the React compiler and get back correct line numbers for tools like vite-plugin-react-click-to-component to work, you should update your config to something like:
export default defineConfig(({ command }) => {
const babelPlugins = [['babel-plugin-react-compiler', {}]]
if (command === 'serve') {
babelPlugins.push(['@​babel/plugin-transform-react-jsx-development', {}])
}
return {
plugins: [react({ babel: { plugins: babelPlugins } })],
}
})
Support HMR for class components
This is a long overdue and should fix some issues people had with HMR when migrating from CRA.
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.