Departures
FE-202STAGate 07

State Management

Scheduled

Migrate Redux + epics + redux-first-router to React Context, one topic at a time.

State Management — Key Takeaways

One Context per topic, one hook per concern, one root that composes them — same content, organized luggage.

  1. 01One source per question
    • No more Redux vs. Apollo vs. Context disagreeing
    • Siblings on the same screen agree
    • Change once — applies everywhere
  2. 02Stop the bleeding
    • Kill HOC + mapStateToProps
    • useSelector at the point of need
    • No prop drilling for state-derived values
  3. 03One Context per topic
    • Composed in a single root provider
    • Typed useX() hook per concern
    • Viewport and Modals are next
  4. 04The payoff
    • Faster development — obvious where things live
    • Better performance — fewer redundant re-renders
    • Fewer bugs — a more reliable app

Same content, organized luggage — a finite, named structure instead of five places that might disagree.