Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
Classify state by owner and lifetime: move server data to a server-state cache, colocate UI state with the components that use it, keep URL state in the URL, and keep only truly global state in a store read through fine-grained selectors.
Start by measuring which updates cause expensive renders, then classify each piece of state. Fetched data belongs in a server-state cache with its own invalidation. Filters, pagination and selected tabs that should survive reloads and be shareable belong in the URL. Form and modal state should live in the component or feature that owns it. The remainder, such as the current user or feature flags, can stay global, but components should subscribe through selectors that return small stable values so they re-render only when their slice changes. Migrate feature by feature, with profiling before and after each step, rather than rewriting everything at once.