Home / File/ ReactFiberThenable.js — react Source File

ReactFiberThenable.js — react Source File

Architecture documentation for ReactFiberThenable.js, a javascript file in the react codebase. 7 imports, 7 dependents.

File javascript BabelCompiler 7 imports 7 dependents

Entity Profile

Dependency Diagram

graph LR
  84b71fa6_312c_e7e3_dedb_27d6c638bf05["ReactFiberThenable.js"]
  270d2932_6cca_c1c4_3f30_496c0c886bb5["ReactFiberCallUserSpace.js"]
  84b71fa6_312c_e7e3_dedb_27d6c638bf05 --> 270d2932_6cca_c1c4_3f30_496c0c886bb5
  d73e9290_2d2e_5d3f_97dd_84929f205c77["ReactFiberWorkLoop.js"]
  84b71fa6_312c_e7e3_dedb_27d6c638bf05 --> d73e9290_2d2e_5d3f_97dd_84929f205c77
  d8f20c67_f5fa_0f0a_c967_c41fd9ffce07["ReactTypes"]
  84b71fa6_312c_e7e3_dedb_27d6c638bf05 --> d8f20c67_f5fa_0f0a_c967_c41fd9ffce07
  ebbd7451_c238_0c5d_d01e_21d7c2d60653["ReactLazy"]
  84b71fa6_312c_e7e3_dedb_27d6c638bf05 --> ebbd7451_c238_0c5d_d01e_21d7c2d60653
  1c5695a6_6806_ba54_2074_efc779e66da4["ReactSharedInternals"]
  84b71fa6_312c_e7e3_dedb_27d6c638bf05 --> 1c5695a6_6806_ba54_2074_efc779e66da4
  8344de1b_978c_be0f_eebd_38ccc4962a93["ReactFeatureFlags"]
  84b71fa6_312c_e7e3_dedb_27d6c638bf05 --> 8344de1b_978c_be0f_eebd_38ccc4962a93
  4321c04c_6e7b_409b_4c59_c09fbf7074a8["noop"]
  84b71fa6_312c_e7e3_dedb_27d6c638bf05 --> 4321c04c_6e7b_409b_4c59_c09fbf7074a8
  8a694f3e_c887_fb18_4515_e3e4488bb43e["ReactChildFiber.js"]
  8a694f3e_c887_fb18_4515_e3e4488bb43e --> 84b71fa6_312c_e7e3_dedb_27d6c638bf05
  0be70812_cc0c_b210_f84f_8e61dd5f831c["ReactFiberBeginWork.js"]
  0be70812_cc0c_b210_f84f_8e61dd5f831c --> 84b71fa6_312c_e7e3_dedb_27d6c638bf05
  6b05669d_2f09_63a5_e79f_0afc195f25a3["ReactFiberCompleteWork.js"]
  6b05669d_2f09_63a5_e79f_0afc195f25a3 --> 84b71fa6_312c_e7e3_dedb_27d6c638bf05
  85d2c68c_7609_2c66_22fb_5f02e8a2e8fe["ReactFiberHooks.js"]
  85d2c68c_7609_2c66_22fb_5f02e8a2e8fe --> 84b71fa6_312c_e7e3_dedb_27d6c638bf05
  2945bdb1_d075_d792_a028_13eee518c9d4["ReactFiberThrow.js"]
  2945bdb1_d075_d792_a028_13eee518c9d4 --> 84b71fa6_312c_e7e3_dedb_27d6c638bf05
  d73e9290_2d2e_5d3f_97dd_84929f205c77["ReactFiberWorkLoop.js"]
  d73e9290_2d2e_5d3f_97dd_84929f205c77 --> 84b71fa6_312c_e7e3_dedb_27d6c638bf05
  6b9f5caa_fb13_3d3c_2f60_ad3c4f58371f["ReactInternalTypes.js"]
  6b9f5caa_fb13_3d3c_2f60_ad3c4f58371f --> 84b71fa6_312c_e7e3_dedb_27d6c638bf05
  style 84b71fa6_312c_e7e3_dedb_27d6c638bf05 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

import type {
  Thenable,
  PendingThenable,
  FulfilledThenable,
  RejectedThenable,
  ReactIOInfo,
} from 'shared/ReactTypes';

import type {LazyComponent as LazyComponentType} from 'react/src/ReactLazy';

import {callLazyInitInDEV} from './ReactFiberCallUserSpace';

import {getWorkInProgressRoot} from './ReactFiberWorkLoop';

import ReactSharedInternals from 'shared/ReactSharedInternals';

import {enableAsyncDebugInfo} from 'shared/ReactFeatureFlags';

import noop from 'shared/noop';

opaque type ThenableStateDev = {
  didWarnAboutUncachedPromise: boolean,
  thenables: Array<Thenable<any>>,
};

opaque type ThenableStateProd = Array<Thenable<any>>;

export opaque type ThenableState = ThenableStateDev | ThenableStateProd;

function getThenablesFromState(state: ThenableState): Array<Thenable<any>> {
  if (__DEV__) {
    const devState: ThenableStateDev = (state: any);
    return devState.thenables;
  } else {
    const prodState = (state: any);
    return prodState;
  }
}

// An error that is thrown (e.g. by `use`) to trigger Suspense. If we
// detect this is caught by userspace, we'll log a warning in development.
export const SuspenseException: mixed = new Error(
  "Suspense Exception: This is not a real error! It's an implementation " +
    'detail of `use` to interrupt the current render. You must either ' +
    'rethrow it immediately, or move the `use` call outside of the ' +
    '`try/catch` block. Capturing without rethrowing will lead to ' +
    'unexpected behavior.\n\n' +
    'To handle async errors, wrap your component in an error boundary, or ' +
    "call the promise's `.catch` method and pass the result to `use`.",
);

// ... (314 more lines)

Domain

Dependencies

Frequently Asked Questions

What does ReactFiberThenable.js do?
ReactFiberThenable.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does ReactFiberThenable.js depend on?
ReactFiberThenable.js imports 7 module(s): ReactFeatureFlags, ReactFiberCallUserSpace.js, ReactFiberWorkLoop.js, ReactLazy, ReactSharedInternals, ReactTypes, noop.
What files import ReactFiberThenable.js?
ReactFiberThenable.js is imported by 7 file(s): ReactChildFiber.js, ReactFiberBeginWork.js, ReactFiberCompleteWork.js, ReactFiberHooks.js, ReactFiberThrow.js, ReactFiberWorkLoop.js, ReactInternalTypes.js.
Where is ReactFiberThenable.js in the architecture?
ReactFiberThenable.js is located at packages/react-reconciler/src/ReactFiberThenable.js (domain: BabelCompiler, directory: packages/react-reconciler/src).

Analyze Your Own Codebase

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

Try Supermodel Free