> move files around until it feels right
state = mutable data
discussion independent of techniques for reusing logic (higher order components, render props, hooks, component composition)
React
single state tree (redux, mobx)
react context
atomic state (recoil, jotai)
network cache (Apollo, Relay, react-query, SWR)
global objects
component state
accessible state (external URL configuration)
UI state (active tooltip, open modal)
remote state (server session)
Experience
Performance
Flexibility
Scalability
Costs
Introduction to react-query. A Redux alternative?
"[...] one of the things that makes state management so difficult is that we often over-engineer our solution to the problem."
"Keep state as close to where it's needed as possible." - Kent C. Dodds
leverage standard visual states in CSS (hover, focus...)
encapsulate code and colocate it near its usage
when referring to errors use compatible Error instances
use a naming pattern for boolean values (e.g. isX, hasX)
start locally to reduce the risk of global side affects
differentiate between different types of state
By Stefan
Reflect on handling data in react applications
Web Engineer & Gaming Enthusiast