github vitejs/vite-plugin-react plugin-react@4.7.0

latest releases: plugin-rsc@0.5.24, plugin-rsc@0.5.23, plugin-rsc@0.5.22...
9 months ago

Add HMR support for compound components (#518)

HMR now works for compound components like this:

const Root = () => <div>Accordion Root</div>
const Item = () => <div>Accordion Item</div>

export const Accordion = { Root, Item }

Return Plugin[] instead of PluginOption[] (#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:

// previously this causes type errors
react({ babel: { plugins: ['babel-plugin-react-compiler'] } })
  .map(p => ({ ...p, applyToEnvironment: e => e.name === 'client' }))

Don't miss a new vite-plugin-react release

NewReleases is sending notifications on new releases.