Home / Function/ clampState() — react Function Reference

clampState() — react Function Reference

Architecture documentation for the clampState() function in scrollState.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  f077803e_adfb_e522_43d4_7b720fa272fa["clampState()"]
  d0e34df5_54e0_bd63_7394_3bfe61a4c376["scrollState.js"]
  f077803e_adfb_e522_43d4_7b720fa272fa -->|defined in| d0e34df5_54e0_bd63_7394_3bfe61a4c376
  4ebde1c0_8d0a_f0b3_0dcd_03c2a6a016e2["AutoSizedCanvas()"]
  4ebde1c0_8d0a_f0b3_0dcd_03c2a6a016e2 -->|calls| f077803e_adfb_e522_43d4_7b720fa272fa
  a56c87e4_5abf_4094_4e1a_cc6225040263["setScrollState()"]
  a56c87e4_5abf_4094_4e1a_cc6225040263 -->|calls| f077803e_adfb_e522_43d4_7b720fa272fa
  350965f1_fa72_4cdc_355c_903fbb465115["_setScrollState()"]
  350965f1_fa72_4cdc_355c_903fbb465115 -->|calls| f077803e_adfb_e522_43d4_7b720fa272fa
  9bc9912f_7f92_4c87_d104_a207cdecc2a5["clampOffset()"]
  f077803e_adfb_e522_43d4_7b720fa272fa -->|calls| 9bc9912f_7f92_4c87_d104_a207cdecc2a5
  e2f6ebe3_ac75_1cab_957c_094eec05800e["clampLength()"]
  f077803e_adfb_e522_43d4_7b720fa272fa -->|calls| e2f6ebe3_ac75_1cab_957c_094eec05800e
  style f077803e_adfb_e522_43d4_7b720fa272fa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-timeline/src/view-base/utils/scrollState.js lines 60–80

export function clampState({
  state,
  minContentLength,
  maxContentLength,
  containerLength,
}: {
  state: ScrollState,
  minContentLength: number,
  maxContentLength: number,
  containerLength: number,
}): ScrollState {
  return clampOffset(
    clampLength({
      state,
      minContentLength,
      maxContentLength,
      containerLength,
    }),
    containerLength,
  );
}

Domain

Subdomains

Frequently Asked Questions

What does clampState() do?
clampState() is a function in the react codebase, defined in packages/react-devtools-timeline/src/view-base/utils/scrollState.js.
Where is clampState() defined?
clampState() is defined in packages/react-devtools-timeline/src/view-base/utils/scrollState.js at line 60.
What does clampState() call?
clampState() calls 2 function(s): clampLength, clampOffset.
What calls clampState()?
clampState() is called by 3 function(s): AutoSizedCanvas, _setScrollState, setScrollState.

Analyze Your Own Codebase

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

Try Supermodel Free