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

Function ref

packages/react-aria/test/utils/useObjectRef.test.js:157–164  ·  view source on GitHub ↗
(_ref)

Source from the content-addressed store, hash-verified

155 const nullHandler = jest.fn();
156
157 function ref(_ref) {
158 if (_ref) {
159 setup();
160 } else {
161 nullHandler();
162 }
163 return cleanUp;
164 }
165
166 const TextField = React.forwardRef((props, forwardedRef) => {
167 const ref = useObjectRef(forwardedRef);

Callers 1

setRefFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected