MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / useComposedRef

Function useComposedRef

packages/react/src/lib/compose-refs.ts:30–33  ·  view source on GitHub ↗
(
  outer: React.Ref<T> | undefined,
  local: React.RefObject<T | null>,
)

Source from the content-addressed store, hash-verified

28/** `composedRefCallback`, kept stable across renders for stable inputs so the
29 * incoming ref is not detached and reattached on every render. */
30export const useComposedRef = <T>(
31 outer: React.Ref<T> | undefined,
32 local: React.RefObject<T | null>,
33): React.RefCallback<T> => React.useMemo(() => composedRefCallback(outer, local), [outer, local]);

Callers 2

DialogContentFunction · 0.90
SheetContentFunction · 0.90

Calls 1

composedRefCallbackFunction · 0.85

Tested by

no test coverage detected