MCPcopy
hub / github.com/facebook/react / ref

Function ref

packages/react-dom/src/__tests__/refs-test.js:536–543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534 let current = null;
535
536 const ref = r => {
537 current = r;
538 createCalls++;
539 return () => {
540 current = null;
541 cleanupCalls++;
542 };
543 };
544
545 await act(async () => {
546 root.render(<ImperativeHandleComponent name="Alice" ref={ref} />);

Callers 3

commitAttachRefFunction · 0.85
safelyDetachRefFunction · 0.85
ReactFiberHooks.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected