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

Function createRenderTask

packages/react-server/src/ReactFizzServer.js:843–897  ·  view source on GitHub ↗
(
  request: Request,
  thenableState: ThenableState | null,
  node: ReactNodeList,
  childIndex: number,
  blockedBoundary: Root | SuspenseBoundary,
  blockedSegment: Segment,
  blockedPreamble: null | Preamble,
  hoistableState: null | HoistableState,
  abortSet: Set<Task>,
  keyPath: Root | KeyNode,
  formatContext: FormatContext,
  context: ContextSnapshot,
  treeContext: TreeContext,
  row: null | SuspenseListRow,
  componentStack: null | ComponentStackNode,
  legacyContext: LegacyContext,
  debugTask: null | ConsoleTask,
)

Source from the content-addressed store, hash-verified

841}
842
843function createRenderTask(
844 request: Request,
845 thenableState: ThenableState | null,
846 node: ReactNodeList,
847 childIndex: number,
848 blockedBoundary: Root | SuspenseBoundary,
849 blockedSegment: Segment,
850 blockedPreamble: null | Preamble,
851 hoistableState: null | HoistableState,
852 abortSet: Set<Task>,
853 keyPath: Root | KeyNode,
854 formatContext: FormatContext,
855 context: ContextSnapshot,
856 treeContext: TreeContext,
857 row: null | SuspenseListRow,
858 componentStack: null | ComponentStackNode,
859 legacyContext: LegacyContext,
860 debugTask: null | ConsoleTask,
861): RenderTask {
862 request.allPendingTasks++;
863 if (blockedBoundary === null) {
864 request.pendingRootTasks++;
865 } else {
866 blockedBoundary.pendingTasks++;
867 }
868 if (row !== null) {
869 row.pendingTasks++;
870 }
871 const task: RenderTask = ({
872 replay: null,
873 node,
874 childIndex,
875 ping: () => pingTask(request, task),
876 blockedBoundary,
877 blockedSegment,
878 blockedPreamble,
879 hoistableState,
880 abortSet,
881 keyPath,
882 formatContext,
883 context,
884 treeContext,
885 row,
886 componentStack,
887 thenableState,
888 }: any);
889 if (!disableLegacyContext) {
890 task.legacyContext = legacyContext;
891 }
892 if (__DEV__) {
893 task.debugTask = debugTask;
894 }
895 abortSet.add(task);
896 return task;
897}
898
899function createReplayTask(
900 request: Request,

Callers 4

createRequestFunction · 0.85
resumeRequestFunction · 0.85
renderSuspenseBoundaryFunction · 0.85

Calls 2

addMethod · 0.80
pingTaskFunction · 0.70

Tested by

no test coverage detected