Skip to content

State Management

GarvxT edited this page Mar 26, 2026 · 1 revision

State Management

The project uses React Context API for global state.

There are two main global stores:

  • AlgorithmContext
  • DataStructureContext

Why Global State?

Global state is used for:

  • Speed
  • Array Size
  • Grid Size
  • Running State
  • Stop Button
  • Input Values

Flow

Context → Custom Hook → Page → Components

Custom hooks used:

  • useSorting
  • useSearching
  • useGridTraversal
  • useTraversal
  • useStack

Clone this wiki locally