MCPcopy
hub / github.com/preactjs/preact / useRef

Function useRef

hooks/src/index.js:303–306  ·  view source on GitHub ↗
(initialValue)

Source from the content-addressed store, hash-verified

301
302/** @type {(initialValue: unknown) => unknown} */
303export function useRef(initialValue) {
304 currentHook = 5;
305 return useMemo(() => ({ current: initialValue }), []);
306}
307
308/**
309 * @param {object} ref

Callers 12

CounterFunction · 0.90
CompFunction · 0.90
CompFunction · 0.90
AppFunction · 0.90
InnerFunction · 0.90
AppFunction · 0.90
CompFunction · 0.90
ParentFunction · 0.85
AppFunction · 0.85
MobXDemoFunction · 0.85

Calls 1

useMemoFunction · 0.85

Tested by 10

CounterFunction · 0.72
CompFunction · 0.72
CompFunction · 0.72
AppFunction · 0.72
InnerFunction · 0.72
AppFunction · 0.72
CompFunction · 0.72
ParentFunction · 0.68
AppFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…