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

Function Component

packages/react-reconciler/src/__tests__/useMemoCache-test.js:62–69  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

60
61 it('render component using cache', async () => {
62 function Component(props) {
63 const cache = useMemoCache(1);
64 expect(Array.isArray(cache)).toBe(true);
65 expect(cache.length).toBe(1);
66 expect(cache[0]).toBe(MemoCacheSentinel);
67
68 return 'Ok';
69 }
70 const root = ReactNoop.createRoot();
71 await act(() => {
72 root.render(<Component />);

Callers 2

ReactFiberHooks.jsFile · 0.50

Calls 3

toBeMethod · 0.65
useMemoCacheFunction · 0.50
useStateFunction · 0.50

Tested by

no test coverage detected