useHover (Web only)

Handles pointer hover interactions for an element. Normalizes behavior across browsers and platforms, and ignores emulated mouse events on touch devices.

Install#

yarn add @react-native-aria/interactions

Import#

import { useHover } from '@react-native-aria/interactions'

API#

useHover(props: HoverProps, ref: RefObject): HoverResult

HoverProps#

HoverResult#

{
/** Props to spread on the target element. */
hoverProps: HTMLAttributes<HTMLElement>,
isHovered: boolean
}

Example#

Last updated on by Nishan