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

Function useDOMRef

packages/@adobe/react-spectrum/src/utils/useDOMRef.ts:47–53  ·  view source on GitHub ↗
(
  ref: DOMRef<T>
)

Source from the content-addressed store, hash-verified

45}
46
47export function useDOMRef<T extends HTMLElement = HTMLElement>(
48 ref: DOMRef<T>
49): RefObject<T | null> {
50 let domRef = useRef<T>(null);
51 useImperativeHandle(ref, () => createDOMRef(domRef));
52 return domRef;
53}
54
55export function useFocusableRef<T extends HTMLElement = HTMLElement>(
56 ref: FocusableRef<T>,

Callers 15

Tabs.tsxFile · 0.90
ProgressCircle.tsxFile · 0.90
Grid.tsxFile · 0.90
Flex.tsxFile · 0.90
Image.tsxFile · 0.90
CheckboxGroup.tsxFile · 0.90
Breadcrumbs.tsxFile · 0.90
ButtonGroup.tsxFile · 0.90
Avatar.tsxFile · 0.90
Accordion.tsxFile · 0.90
StatusLight.tsxFile · 0.90

Calls 1

createDOMRefFunction · 0.70

Tested by

no test coverage detected