import { RefObject } from 'react'; /** * react-aria's `usePopover` only recalculates the overlay position when the window, trigger or overlay *resizes*. * If the trigger *moves* without resizing (e.g. content above it is conditionally rendered and shifts the layout), * the overlay is left behind. See https://github.com/adobe/react-spectrum/issues/6424. * * While the overlay is open this hook compares the trigger's position against the overlay's whenever something * could have moved it: after every render of the calling component (covers shifts caused by React state, before * the browser paints) and whenever the trigger's position in the viewport changes (covers everything else: shifts * from outside React such as an image loading above it, and React updates that don't re-render this component, * even when they happen inside a fixed-size container that no `ResizeObserver` would see change). Nothing runs * while the page is idle. * * Only a move of the *trigger* that changes its offset from the overlay counts: page scroll moves both by the same * amount, and the overlay moving on its own is it catching up with the trigger (or flipping), neither of which needs * another recalculation. When a move is detected, the returned `shouldUpdatePosition` flag flips to `false` for one * render and back to `true`, which re-runs `useOverlayPosition`'s layout effect. Pass the result as the * `shouldUpdatePosition` option of `usePopover`. */ export declare function useRepositionOnTriggerMove(triggerRef: RefObject, overlayRef: RefObject, isOpen: boolean): boolean;