Home / Function/ callServer() — react Function Reference

callServer() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  00e064ed_8db5_1ed6_fa2f_55a0ba1805eb["callServer()"]
  6daff291_f5b6_50fc_a8dc_9451815076ff["index.js"]
  00e064ed_8db5_1ed6_fa2f_55a0ba1805eb -->|defined in| 6daff291_f5b6_50fc_a8dc_9451815076ff
  style 00e064ed_8db5_1ed6_fa2f_55a0ba1805eb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

fixtures/flight-esm/src/index.js lines 17–36

async function callServer(id, args) {
  const response = fetch('/', {
    method: 'POST',
    headers: {
      Accept: 'text/x-component',
      'rsc-action': id,
    },
    body: await encodeReply(args),
  });
  const {returnValue, root} = await createFromFetch(response, {
    callServer,
    moduleBaseURL,
    findSourceMapURL,
  });
  // Refresh the tree with the new RSC payload.
  startTransition(() => {
    updateRoot(root);
  });
  return returnValue;
}

Domain

Subdomains

Frequently Asked Questions

What does callServer() do?
callServer() is a function in the react codebase, defined in fixtures/flight-esm/src/index.js.
Where is callServer() defined?
callServer() is defined in fixtures/flight-esm/src/index.js at line 17.

Analyze Your Own Codebase

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

Try Supermodel Free