MCPcopy Index your code
hub / github.com/adobe/react-spectrum / Example

Function Example

packages/react-aria/test/overlays/useOverlay.test.js:23–33  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

21import {useOverlay} from '../../src/overlays/useOverlay';
22
23function Example(props) {
24 let ref = useRef();
25 let {overlayProps, underlayProps} = useOverlay(props, ref);
26 return (
27 <div {...mergeProps(underlayProps, props.underlayProps || {})}>
28 <div ref={ref} {...overlayProps} data-testid={props['data-testid'] || 'test'}>
29 {props.children}
30 </div>
31 </div>
32 );
33}
34
35describe('useOverlay', function () {
36 describe.each`

Callers

nothing calls this directly

Calls 2

useOverlayFunction · 0.90
mergePropsFunction · 0.90

Tested by

no test coverage detected