A hook to merge or compose interaction event handlers together,
preserving memoization.
Interaction Hooks like useHover() and useFocus() do
two things: they set up Effects inside the Hook that work on
their own, and return event handlers intended to be passed to the
elements to add their functionality.
The Hook returns two core prop getters, one for the reference
element and one for the floating element. These prop getters
should be spread onto the elements:
All event handlers you pass in should be done so through the prop
getter, not the element itself:
This is because your handler may be either overwritten or
overwrite one of the Hooks’ handlers. More event handlers may
also be added in future versions.
A third prop getter is returned for item elements when dealing
with a list inside the floating element, which is not required
for all types of floating elements. See
useRole for more information on this prop
getter for listbox (e.g. select or combobox) or menu roles.