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

Function fn

packages/react-reconciler/src/__tests__/ReactMemo-test.js:504–522  ·  view source on GitHub ↗
(props, ref)

Source from the content-addressed store, hash-verified

502
503 it('should use the inner name in the stack', async () => {
504 const fn = (props, ref) => {
505 return [<span />];
506 };
507 Object.defineProperty(fn, 'name', {value: 'Inner'});
508 const MemoComponent = React.memo(fn);
509 ReactNoop.render(
510 <p>
511 <MemoComponent />
512 </p>,
513 );
514 await waitForAll([]);
515 assertConsoleErrorDev([
516 'Each child in a list should have a unique "key" prop.' +
517 '\n\nCheck the top-level render call using <Inner>. It was passed a child from Inner. ' +
518 'See https://react.dev/link/warning-keys for more information.\n' +
519 ' in span (at **)\n' +
520 ' in Inner (at **)',
521 ]);
522 });
523
524 it('can use the outer displayName in the stack', async () => {
525 const MemoComponent = React.memo((props, ref) => {

Callers 15

traverseTwoPhaseFunction · 0.50
traverseTwoPhaseFunction · 0.50
batchedUpdatesImplFunction · 0.50
discreteUpdatesImplFunction · 0.50
batchedUpdatesFunction · 0.50
collectScopedNodesFunction · 0.50
collectFirstScopedNodeFunction · 0.50
deferredUpdatesFunction · 0.50
batchedUpdatesFunction · 0.50
discreteUpdatesFunction · 0.50
flushSyncFromReconcilerFunction · 0.50

Calls 2

waitForAllFunction · 0.85
renderMethod · 0.65

Tested by

no test coverage detected