Home / Function/ selectPrevCommitIndex() — react Function Reference

selectPrevCommitIndex() — react Function Reference

Architecture documentation for the selectPrevCommitIndex() function in useCommitFilteringAndNavigation.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  d078edb7_545a_e058_e0d3_0a96c590a574["selectPrevCommitIndex()"]
  1d558132_0276_7e48_1a18_611bb9fef088["useCommitFilteringAndNavigation.js"]
  d078edb7_545a_e058_e0d3_0a96c590a574 -->|defined in| 1d558132_0276_7e48_1a18_611bb9fef088
  style d078edb7_545a_e058_e0d3_0a96c590a574 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shared/src/devtools/views/Profiler/useCommitFilteringAndNavigation.js lines 142–154

  const selectPrevCommitIndex = useCallback(() => {
    if (
      selectedFilteredCommitIndex === null ||
      filteredCommitIndices.length === 0
    ) {
      return;
    }
    let prevCommitIndex = selectedFilteredCommitIndex - 1;
    if (prevCommitIndex < 0) {
      prevCommitIndex = filteredCommitIndices.length - 1;
    }
    selectCommitIndex(filteredCommitIndices[prevCommitIndex]);
  }, [selectedFilteredCommitIndex, filteredCommitIndices, selectCommitIndex]);

Domain

Subdomains

Frequently Asked Questions

What does selectPrevCommitIndex() do?
selectPrevCommitIndex() is a function in the react codebase, defined in packages/react-devtools-shared/src/devtools/views/Profiler/useCommitFilteringAndNavigation.js.
Where is selectPrevCommitIndex() defined?
selectPrevCommitIndex() is defined in packages/react-devtools-shared/src/devtools/views/Profiler/useCommitFilteringAndNavigation.js at line 142.

Analyze Your Own Codebase

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

Try Supermodel Free