Home / File/ useSyncExternalStoreShim.js — react Source File

useSyncExternalStoreShim.js — react Source File

Architecture documentation for useSyncExternalStoreShim.js, a javascript file in the react codebase. 4 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  62252b8c_44a9_19ca_d235_2a34ff0286e7["useSyncExternalStoreShim.js"]
  c8190e68_5a3d_877d_bd3a_2285ee34abfc["useSyncExternalStoreShimClient.js"]
  62252b8c_44a9_19ca_d235_2a34ff0286e7 --> c8190e68_5a3d_877d_bd3a_2285ee34abfc
  b40b0a07_0f29_d745_b337_e10522581548["useSyncExternalStoreShimServer.js"]
  62252b8c_44a9_19ca_d235_2a34ff0286e7 --> b40b0a07_0f29_d745_b337_e10522581548
  57b51ec0_5bcd_4fd8_ca10_2c780b1e53d9["isServerEnvironment.js"]
  62252b8c_44a9_19ca_d235_2a34ff0286e7 --> 57b51ec0_5bcd_4fd8_ca10_2c780b1e53d9
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  62252b8c_44a9_19ca_d235_2a34ff0286e7 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  style 62252b8c_44a9_19ca_d235_2a34ff0286e7 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 {useSyncExternalStore as client} from './useSyncExternalStoreShimClient';
import {useSyncExternalStore as server} from './useSyncExternalStoreShimServer';
import {isServerEnvironment} from './isServerEnvironment';
import {useSyncExternalStore as builtInAPI} from 'react';

const shim = isServerEnvironment ? server : client;

export const useSyncExternalStore: <T>(
  subscribe: (() => void) => () => void,
  getSnapshot: () => T,
  getServerSnapshot?: () => T,
) => T = builtInAPI !== undefined ? builtInAPI : shim;

Domain

Frequently Asked Questions

What does useSyncExternalStoreShim.js do?
useSyncExternalStoreShim.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does useSyncExternalStoreShim.js depend on?
useSyncExternalStoreShim.js imports 4 module(s): isServerEnvironment.js, react, useSyncExternalStoreShimClient.js, useSyncExternalStoreShimServer.js.
Where is useSyncExternalStoreShim.js in the architecture?
useSyncExternalStoreShim.js is located at packages/use-sync-external-store/src/useSyncExternalStoreShim.js (domain: BabelCompiler, directory: packages/use-sync-external-store/src).

Analyze Your Own Codebase

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

Try Supermodel Free