@floating-ui/react-dom
2.1.9 · 11 Jul 2026MIT112.9M / weekRepositoryHomepagenpmAtom feed
2.1.9 is the newest release of 2.x.
In short
3 breaking2 new1 fixed
- breaking
Default
xandycoordinates to0instead ofnull - breaking
Remove deprecated top-level
referenceandfloatingref setters - breaking
whileElementsMountedtype requires cleanup function
Release note
This release aims to simplify the API and remove some deprecated properties. If you've been using the refs.set* functions since their addition in January (1.2.0), then you can freely upgrade without changing any of your code.
Breaking Changes
- breaking
Default
xandycoordinates to0instead ofnullisPositionedlets you know if the floating element has been positioned. - breaking
Remove deprecated top-level
referenceandfloatingref settersThese are in the
refsobject:reference->refs.setReferencefloating->refs.setFloating
- breaking
whileElementsMountedtype requires cleanup function
New Features
floatingStylesobjectPre-configured positioning styles for the majority of cases:
const {refs, floatingStyles} = useFloating(); return <div ref={refs.setFloating} style={floatingStyles} />;External element synchronization in the hook
Avoid using layout effects:
const {refs} = useFloating({ elements: { // Either can be specified optionally reference: referenceElement, floating: floatingElement, }, }); // refs.setReference / refs.setFloating can be mix and matched
Bug Fixes
types: Allow
nullforarrow'selementoption