Episode 2 — React Frontend Architecture NextJS / 2.13 — Global State Management

2.13 — Exercise Questions: Global State Management

<< 2.13 Overview


Exercise 01

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 02

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 03

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 04

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 05

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 06

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 07

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 08

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 09

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 10

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 11

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 12

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 13

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 14

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 15

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 16

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 17

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 18

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 19

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 20

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 21

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 22

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 23

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 24

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 25

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 26

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 27

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 28

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 29

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 30

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 31

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 32

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 33

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 34

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 35

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 36

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 37

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 38

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 39

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 40

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 41

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 42

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 43

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 44

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 45

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 46

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 47

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 48

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 49

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 50

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 51

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 52

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 53

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 54

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 55

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 56

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 57

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 58

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 59

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 60

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 61

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 62

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 63

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 64

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 65

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 66

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 67

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 68

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 69

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 70

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 71

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 72

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 73

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 74

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Exercise 75

In a Vite + React sandbox: implement the prompt using Context and again using Zustand; document re-render counts or Profiler notes and when you would pick each.

Deliverables: README table comparing approaches + link to PR.


Answers & guidance

Notes 01

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 02

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 03

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 04

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 05

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 06

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 07

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 08

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 09

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 10

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 11

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 12

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 13

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 14

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 15

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 16

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 17

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 18

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 19

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 20

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 21

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 22

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 23

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 24

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 25

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 26

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 27

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 28

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 29

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 30

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 31

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 32

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 33

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 34

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 35

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 36

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 37

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 38

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 39

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 40

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 41

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 42

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 43

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 44

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 45

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 46

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 47

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 48

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 49

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 50

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 51

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 52

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 53

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 54

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 55

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 56

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 57

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 58

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 59

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 60

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 61

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 62

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 63

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 64

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 65

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 66

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 67

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 68

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 69

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 70

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 71

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 72

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 73

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 74

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

Notes 75

  • Default local; prove shared need.
  • Memoize context values; split hot/cold.
  • Zustand: stable selectors; avoid god store.

<< 2.13 Overview