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

Function Data

packages/react-reconciler/src/__tests__/useMemoCache-test.js:438–471  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

436 // );
437 // }
438 function Data(t0) {
439 const $ = useMemoCache(5);
440 const {chunkA, chunkB} = t0;
441 const t1 = useWithLog(chunkA, 'chunkA');
442 let t2;
443
444 if ($[0] !== t1) {
445 t2 = someExpensiveProcessing(t1);
446 $[0] = t1;
447 $[1] = t2;
448 } else {
449 t2 = $[1];
450 }
451
452 const a = t2;
453 const b = useWithLog(chunkB, 'chunkB');
454 let t3;
455
456 if ($[2] !== a || $[3] !== b) {
457 t3 = (
458 <>
459 {a}
460 {b}
461 </>
462 );
463 $[2] = a;
464 $[3] = b;
465 $[4] = t3;
466 } else {
467 t3 = $[4];
468 }
469
470 return t3;
471 }
472
473 let setInput;
474 function Input() {

Callers

nothing calls this directly

Calls 3

useWithLogFunction · 0.85
someExpensiveProcessingFunction · 0.85
useMemoCacheFunction · 0.50

Tested by

no test coverage detected