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

Function makeApp

packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js:4582–4609  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4580
4581 it('#24384: Suspending should halt hydration warnings and not emit any if hydration completes successfully after unsuspending', async () => {
4582 const makeApp = () => {
4583 let resolve, resolved;
4584 const promise = new Promise(r => {
4585 resolve = () => {
4586 resolved = true;
4587 return r();
4588 };
4589 });
4590 function ComponentThatSuspends() {
4591 if (!resolved) {
4592 throw promise;
4593 }
4594 return <p>A</p>;
4595 }
4596
4597 const App = () => {
4598 return (
4599 <div>
4600 <Suspense fallback={<h1>Loading...</h1>}>
4601 <ComponentThatSuspends />
4602 <h2 name="hello">world</h2>
4603 </Suspense>
4604 </div>
4605 );
4606 };
4607
4608 return [App, resolve];
4609 };
4610
4611 const [ServerApp, serverResolve] = makeApp();
4612 await act(() => {

Callers 2

AppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected