Why state management matters more than it looks
This is one of those topics that looks small until it costs you something. State management is easy to treat as a detail, and that is exactly why it is worth a few minutes of attention.
Most development decisions are really maintenance decisions wearing a different hat. It rarely shows up as a line item, which is exactly why it slips.
What is actually at stake
Most apps need far less shared state than they end up with. Getting it slightly wrong is survivable. Ignoring it entirely is not. Check it against what you would want a competitor's site to get wrong.
Derive values rather than storing them twice. This is the sort of thing that compounds, quietly, in both directions. Assume whoever inherits this will have half your context and none of your patience.
What to watch for
Every duplicated piece of state is a future bug. Where this goes wrong is almost never a lack of knowledge. Most teams find the first pass takes an afternoon and the maintenance takes minutes a month.
The short version
The question is rarely whether something can be built, but what it costs to keep running afterwards. Three things worth confirming about state management before you move on:
- Someone can say what the current setup is without going to look
- Derive values rather than storing them twice — and you know whether that is true here
- There is a way to tell whether the last change to this helped
If you are not sure where your systems currently stand on this, it takes us about an hour to find out.