npm / @floating-ui/react-dom
@floating-ui/react-dom
What changed in @floating-ui/react-dom 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-25.
5 breaking3 new APIs and options3 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@floating-ui/react-dom 211 changes
Breaking changes 5
The deprecated top-level floating ref setter is removed; use refs.setFloating instead.
The deprecated top-level reference ref setter is removed; use refs.setReference instead.
The whileElementsMounted type now requires a cleanup function.
The default x coordinate is 0 instead of null; use isPositioned to determine whether the floating element has been positioned.
The default y coordinate is 0 instead of null; use isPositioned to determine whether the floating element has been positioned.
New APIs and options 3
useFloating accepts an optional floating element in elements for external element synchronization in the hook.
useFloating accepts an optional reference element in elements for external element synchronization in the hook.
useFloating returns a floatingStyles object with pre-configured positioning styles for the majority of cases.
Fixes and other changes 3
Optional properties now support explicit undefined when exactOptionalPropertyTypes is enabled.
Reactive middleware wrappers no longer produce a duplicate
optionskey warning.The arrow element option's type now allows null.