MCPcopy Create free account
hub / github.com/adobe/react-spectrum / Example

Function Example

packages/react-aria/test/interactions/useHover.test.js:28–36  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

26import {useHover} from '../../src/interactions/useHover';
27
28function Example(props) {
29 let {hoverProps, isHovered} = useHover(props);
30 return (
31 <div {...hoverProps}>
32 test{isHovered && '-hovered'}
33 <div data-testid="inner-target" />
34 </div>
35 );
36}
37
38function pointerEvent(type, opts) {
39 let evt = new Event(type, {bubbles: true, cancelable: true});

Callers

nothing calls this directly

Calls 1

useHoverFunction · 0.90

Tested by

no test coverage detected