Home / File/ useSyncExternalStoreShimServer.js — react Source File

useSyncExternalStoreShimServer.js — react Source File

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

Entity Profile

Dependency Diagram

graph LR
  b40b0a07_0f29_d745_b337_e10522581548["useSyncExternalStoreShimServer.js"]
  62252b8c_44a9_19ca_d235_2a34ff0286e7["useSyncExternalStoreShim.js"]
  62252b8c_44a9_19ca_d235_2a34ff0286e7 --> b40b0a07_0f29_d745_b337_e10522581548
  style b40b0a07_0f29_d745_b337_e10522581548 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
 */

export function useSyncExternalStore<T>(
  subscribe: (() => void) => () => void,
  getSnapshot: () => T,
  getServerSnapshot?: () => T,
): T {
  // Note: The shim does not use getServerSnapshot, because pre-18 versions of
  // React do not expose a way to check if we're hydrating. So users of the shim
  // will need to track that themselves and return the correct value
  // from `getSnapshot`.
  return getSnapshot();
}

Domain

Frequently Asked Questions

What does useSyncExternalStoreShimServer.js do?
useSyncExternalStoreShimServer.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What files import useSyncExternalStoreShimServer.js?
useSyncExternalStoreShimServer.js is imported by 1 file(s): useSyncExternalStoreShim.js.
Where is useSyncExternalStoreShimServer.js in the architecture?
useSyncExternalStoreShimServer.js is located at packages/use-sync-external-store/src/useSyncExternalStoreShimServer.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