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

Function Test

packages/react-dom/src/__tests__/ReactDOMFragmentRefs-test.js:94–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92 // @gate enableFragmentRefs
93 it('is available in effects', async () => {
94 function Test() {
95 const fragmentRef = React.useRef(null);
96 React.useLayoutEffect(() => {
97 expect(fragmentRef.current).not.toBe(null);
98 });
99 React.useEffect(() => {
100 expect(fragmentRef.current).not.toBe(null);
101 });
102 return (
103 <Fragment ref={fragmentRef}>
104 <div />
105 </Fragment>
106 );
107 }
108
109 const root = ReactDOMClient.createRoot(container);
110 await act(() => root.render(<Test />));

Callers

nothing calls this directly

Calls 9

expectLastFunction · 0.85
mockClearMethod · 0.80
toHaveBeenCalledTimesMethod · 0.80
actFunction · 0.70
toBeMethod · 0.65
renderMethod · 0.65
toEqualMethod · 0.65
pushMethod · 0.65
setStateFunction · 0.50

Tested by

no test coverage detected