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

Function Example

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

Source from the content-addressed store, hash-verified

24import {useOverlay} from '../../src/overlays/useOverlay';
25
26function Example(props) {
27 let ref = useRef();
28 let {overlayProps, underlayProps} = useOverlay(props, ref);
29 return (
30 <div {...mergeProps(underlayProps, props.underlayProps || {})} data-testid={'underlay'}>
31 <div ref={ref} {...overlayProps} data-testid={props['data-testid'] || 'test'}>
32 {props.children}
33 </div>
34 </div>
35 );
36}
37
38describe('useOverlay with shadow dom', () => {
39 beforeAll(() => {

Callers

nothing calls this directly

Calls 2

useOverlayFunction · 0.90
mergePropsFunction · 0.90

Tested by

no test coverage detected