/react-state-demo

This app showcases eight ways to handle React state.

Primary LanguageJavaScript

This app showcases eight ways to handle React state.

8 ways to handle React state

Each branch implements the same features using different approaches.

Branch State examples
main useState, useRef, web storage, lifted state, derived state
ref useRef for uncontrolled components
context context
immer immer
useReducer useReducer
class Class-based state example
react-query React query for remote state

Quick Start

Make sure you have these installed:

  • Node 10 or newer (To check your version: npm -v)
  • Git

Then, run these commands on the command line:

npm install
npm start

npm start starts the app and the mock API.

This project was bootstrapped with Create React App.