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

Function renderLazyComponent

packages/react-server/src/ReactFizzServer.js:2786–2807  ·  view source on GitHub ↗
(
  request: Request,
  task: Task,
  keyPath: KeyNode,
  lazyComponent: LazyComponentType<any, any>,
  props: Object,
  ref: any,
)

Source from the content-addressed store, hash-verified

2784}
2785
2786function renderLazyComponent(
2787 request: Request,
2788 task: Task,
2789 keyPath: KeyNode,
2790 lazyComponent: LazyComponentType<any, any>,
2791 props: Object,
2792 ref: any,
2793): void {
2794 let Component;
2795 if (__DEV__) {
2796 Component = callLazyInitInDEV(lazyComponent);
2797 } else {
2798 const payload = lazyComponent._payload;
2799 const init = lazyComponent._init;
2800 Component = init(payload);
2801 }
2802 if (request.status === ABORTING) {
2803 // eslint-disable-next-line no-throw-literal
2804 throw null;
2805 }
2806 renderElement(request, task, keyPath, Component, props, ref);
2807}
2808
2809function renderActivity(
2810 request: Request,

Callers 1

renderElementFunction · 0.85

Calls 2

initFunction · 0.70
renderElementFunction · 0.70

Tested by

no test coverage detected