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

Function createContainer

packages/react-reconciler/src/ReactFiberReconciler.js:236–281  ·  view source on GitHub ↗
(
  containerInfo: Container,
  tag: RootTag,
  hydrationCallbacks: null | SuspenseHydrationCallbacks,
  isStrictMode: boolean,
  // TODO: Remove `concurrentUpdatesByDefaultOverride`. It is now ignored.
  concurrentUpdatesByDefaultOverride: null | boolean,
  identifierPrefix: string,
  onUncaughtError: (
    error: mixed,
    errorInfo: {+componentStack?: ?string},
  ) => void,
  onCaughtError: (
    error: mixed,
    errorInfo: {
      +componentStack?: ?string,
      +errorBoundary?: ?component(...props: any),
    },
  ) => void,
  onRecoverableError: (
    error: mixed,
    errorInfo: {+componentStack?: ?string},
  ) => void,
  onDefaultTransitionIndicator: () => void | (() => void),
  transitionCallbacks: null | TransitionTracingCallbacks,
)

Source from the content-addressed store, hash-verified

234}
235
236export function createContainer(
237 containerInfo: Container,
238 tag: RootTag,
239 hydrationCallbacks: null | SuspenseHydrationCallbacks,
240 isStrictMode: boolean,
241 // TODO: Remove `concurrentUpdatesByDefaultOverride`. It is now ignored.
242 concurrentUpdatesByDefaultOverride: null | boolean,
243 identifierPrefix: string,
244 onUncaughtError: (
245 error: mixed,
246 errorInfo: {+componentStack?: ?string},
247 ) => void,
248 onCaughtError: (
249 error: mixed,
250 errorInfo: {
251 +componentStack?: ?string,
252 +errorBoundary?: ?component(...props: any),
253 },
254 ) => void,
255 onRecoverableError: (
256 error: mixed,
257 errorInfo: {+componentStack?: ?string},
258 ) => void,
259 onDefaultTransitionIndicator: () => void | (() => void),
260 transitionCallbacks: null | TransitionTracingCallbacks,
261): OpaqueRoot {
262 const hydrate = false;
263 const initialChildren = null;
264 const root = createFiberRoot(
265 containerInfo,
266 tag,
267 hydrate,
268 initialChildren,
269 hydrationCallbacks,
270 isStrictMode,
271 identifierPrefix,
272 null,
273 onUncaughtError,
274 onCaughtError,
275 onRecoverableError,
276 onDefaultTransitionIndicator,
277 transitionCallbacks,
278 );
279 registerDefaultIndicator(onDefaultTransitionIndicator);
280 return root;
281}
282
283export function createHydrationContainer(
284 initialChildren: ReactNodeList,

Callers 6

componentDidMountMethod · 0.90
renderFunction · 0.90
renderFunction · 0.90
createRootFunction · 0.90
createFunction · 0.90

Calls 2

createFiberRootFunction · 0.90
registerDefaultIndicatorFunction · 0.90

Tested by

no test coverage detected