Home / Function/ scrollBy() — react Function Reference

scrollBy() — react Function Reference

Architecture documentation for the scrollBy() function in VerticalScrollView.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  dd08a669_02e3_2f36_98cb_b33b321d1071["scrollBy()"]
  15e8ee71_cd71_e6f6_40e5_59e8feb4985d["VerticalScrollView"]
  dd08a669_02e3_2f36_98cb_b33b321d1071 -->|defined in| 15e8ee71_cd71_e6f6_40e5_59e8feb4985d
  c53bd458_8fdb_18ff_350b_512cb76d863c["_handleWheelShift()"]
  c53bd458_8fdb_18ff_350b_512cb76d863c -->|calls| dd08a669_02e3_2f36_98cb_b33b321d1071
  b6d7e0eb_672c_2250_5ec1_56607b5e9daa["setScrollOffset()"]
  b6d7e0eb_672c_2250_5ec1_56607b5e9daa -->|calls| dd08a669_02e3_2f36_98cb_b33b321d1071
  350965f1_fa72_4cdc_355c_903fbb465115["_setScrollState()"]
  dd08a669_02e3_2f36_98cb_b33b321d1071 -->|calls| 350965f1_fa72_4cdc_355c_903fbb465115
  94cfe42d_2d3d_5da3_cd07_23705b8b0ec6["translateState()"]
  dd08a669_02e3_2f36_98cb_b33b321d1071 -->|calls| 94cfe42d_2d3d_5da3_cd07_23705b8b0ec6
  style dd08a669_02e3_2f36_98cb_b33b321d1071 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-timeline/src/view-base/VerticalScrollView.js lines 173–184

  scrollBy(deltaY: number): boolean {
    const newState = translateState({
      state: this._scrollState,
      delta: -deltaY,
      containerLength: this.frame.size.height,
    });

    // If the state is updated by this wheel scroll,
    // return true to prevent the interaction from bubbling.
    // For instance, this prevents the outermost container from also scrolling.
    return this._setScrollState(newState);
  }

Domain

Subdomains

Frequently Asked Questions

What does scrollBy() do?
scrollBy() is a function in the react codebase, defined in packages/react-devtools-timeline/src/view-base/VerticalScrollView.js.
Where is scrollBy() defined?
scrollBy() is defined in packages/react-devtools-timeline/src/view-base/VerticalScrollView.js at line 173.
What does scrollBy() call?
scrollBy() calls 2 function(s): _setScrollState, translateState.
What calls scrollBy()?
scrollBy() is called by 2 function(s): _handleWheelShift, setScrollOffset.

Analyze Your Own Codebase

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

Try Supermodel Free