npm / vitest-browser-react
vitest-browser-react
What changed in vitest-browser-react 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-20.
1 breaking5 new APIs and options1 behavior and defaults2 tooling4 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initvitest-browser-react 213 changes
Breaking changes 1
Adds support for async act v2, changing the supported act behavior.
New APIs and options 5
Adds createRootOptions to ComponentRenderOptions.
Exposes page.renderHook.
Integrates trace mark with render.
Adds a locator property.
Adds a RenderOptions type to make migration from RTL easier.
Behavior and default changes 1
A stable testid is attached to the default baseElement and container; snapshots using container may need Vitest 4.0.18 to avoid rendering the injected attribute.
Tooling 2
Adds support for vitest 5, allowing developers to use this package with that version.
Adds support for the new Vitest 4 syntax.
Fixes and other changes 4
Avoids act warnings when using vitest-browser-react.
Injects a consistent testid, making test identifiers more predictable.
Use a simple counter for act.
Unwanted tsconfig options were removed.