Commit 8bb8299
authored
Update dependency @vitejs/plugin-react to v4.7.0
| datasource | package | from | to |
| ---------- | -------------------- | ----- | ----- |
| npm | @vitejs/plugin-react | 4.6.0 | 4.7.0 |
## [v4.7.0](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#470-2025-07-18)
##### Add HMR support for compound components ([#518](vitejs/vite-plugin-react#518))
HMR now works for compound components like this:
```tsx
const Root = () => <div>Accordion Root</div>
const Item = () => <div>Accordion Item</div>
export const Accordion = { Root, Item }
```
##### Return `Plugin[]` instead of `PluginOption[]` ([#537](vitejs/vite-plugin-react#537))
The return type has changed from `react(): PluginOption[]` to more specialized type `react(): Plugin[]`. This allows for type-safe manipulation of plugins, for example:
```tsx
// previously this causes type errors
react({ babel: { plugins: ['babel-plugin-react-compiler'] } })
.map(p => ({ ...p, applyToEnvironment: e => e.name === 'client' }))
```1 parent 4f724c8 commit 8bb8299
2 files changed
+61
-288
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments