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

Function unwrapDOMRef

packages/@react-spectrum/s2/src/useDOMRef.ts:58–66  ·  view source on GitHub ↗
(
  ref: RefObject<DOMRefValue<T> | null>
)

Source from the content-addressed store, hash-verified

56}
57
58export function unwrapDOMRef<T extends HTMLElement>(
59 ref: RefObject<DOMRefValue<T> | null>
60): RefObject<T | null> {
61 return {
62 get current() {
63 return ref.current && ref.current.UNSAFE_getDOMNode();
64 }
65 };
66}
67
68export function useUnwrapDOMRef<T extends HTMLElement>(
69 ref: RefObject<DOMRefValue<T> | null>

Callers 2

DialogButtonFunction · 0.90
useUnwrapDOMRefFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected