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

Function createDOMRef

packages/@react-spectrum/ai/src/useDOMRef.ts:16–24  ·  view source on GitHub ↗
(
  ref: RefObject<T | null>
)

Source from the content-addressed store, hash-verified

14import {useImperativeHandle, useRef} from 'react';
15
16export function createDOMRef<T extends HTMLElement = HTMLElement>(
17 ref: RefObject<T | null>
18): DOMRefValue<T> {
19 return {
20 UNSAFE_getDOMNode() {
21 return ref.current;
22 }
23 };
24}
25
26export function useDOMRef<T extends HTMLElement = HTMLElement>(
27 ref: DOMRef<T>

Callers 1

useDOMRefFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected