Home / Function/ Suspend() — react Function Reference

Suspend() — react Function Reference

Architecture documentation for the Suspend() function in Suspend.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  22bc10f4_95be_7c70_000e_37d1a72395ff["Suspend()"]
  f813bc2a_b9af_b53b_4605_1567ea7ffbc1["Suspend.js"]
  22bc10f4_95be_7c70_000e_37d1a72395ff -->|defined in| f813bc2a_b9af_b53b_4605_1567ea7ffbc1
  style 22bc10f4_95be_7c70_000e_37d1a72395ff fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

fixtures/ssr/src/components/Suspend.js lines 4–22

export default function Suspend({children}) {
  // This will suspend the content from rendering but only on the client.
  // This is used to demo a slow loading app.
  if (!isResolved) {
    if (promise === null) {
      promise = new Promise(resolve => {
        setTimeout(
          () => {
            isResolved = true;
            resolve();
          },
          typeof window === 'object' ? 6000 : 1000
        );
      });
    }
    throw promise;
  }
  return children;
}

Domain

Subdomains

Frequently Asked Questions

What does Suspend() do?
Suspend() is a function in the react codebase, defined in fixtures/ssr/src/components/Suspend.js.
Where is Suspend() defined?
Suspend() is defined in fixtures/ssr/src/components/Suspend.js at line 4.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free