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

Function Sibling

packages/react-reconciler/src/__tests__/ReactAsyncActions-test.js:1269–1284  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1267 let setText;
1268 let setOptimisticText;
1269 function Sibling() {
1270 const [canonicalText, _setText] = useState('A');
1271 setText = _setText;
1272
1273 const [text, _setOptimisticText] = useOptimistic(
1274 canonicalText,
1275 (_, optimisticText) => `${optimisticText} (loading...)`,
1276 );
1277 setOptimisticText = _setOptimisticText;
1278
1279 return (
1280 <span>
1281 <Text text={text} />
1282 </span>
1283 );
1284 }
1285
1286 function App({showUpdater}) {
1287 return (

Callers

nothing calls this directly

Calls 2

useStateFunction · 0.50
useOptimisticFunction · 0.50

Tested by

no test coverage detected