Home / File/ repro-destructure-from-prop-with-default-value.js — react Source File

repro-destructure-from-prop-with-default-value.js — react Source File

Architecture documentation for repro-destructure-from-prop-with-default-value.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

// @validateExhaustiveMemoizationDependencies:false
export function useFormatRelativeTime(opts = {}) {
  const {timeZone, minimal} = opts;
  const format = useCallback(function formatWithUnit() {}, [minimal]);
  // We previously recorded `{timeZone}` as capturing timeZone into the object,
  // then assumed that dateTimeFormat() mutates that object,
  // which in turn could mutate timeZone and the object it came from,
  // which meanteans that the value `minimal` is derived from can change.
  //
  // The fix was to record a Capture from a maybefrozen value as an ImmutableCapture
  // which doesn't propagate mutations
  dateTimeFormat({timeZone});
  return format;
}

Domain

Subdomains

Frequently Asked Questions

What does repro-destructure-from-prop-with-default-value.js do?
repro-destructure-from-prop-with-default-value.js is a source file in the react codebase, written in javascript. It belongs to the CompilerCore domain, BabelIntegration subdomain.
What functions are defined in repro-destructure-from-prop-with-default-value.js?
repro-destructure-from-prop-with-default-value.js defines 1 function(s): useFormatRelativeTime.
Where is repro-destructure-from-prop-with-default-value.js in the architecture?
repro-destructure-from-prop-with-default-value.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability/repro-destructure-from-prop-with-default-value.js (domain: CompilerCore, subdomain: BabelIntegration, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability).

Analyze Your Own Codebase

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

Try Supermodel Free