Identify the minimal complete representation of UI state in a component.
The cleanest state model is the one with the fewest facts that can disagree. Source state changes by itself A text input, selected tab, server response, or open dialog flag can be state because it changes over time and cannot be computed from another value already available to the component. Derived values are calculations Filtered rows, counts, labels, disabled flags, and visual variants are often calculations. Storing them creates a second source that must be kept in sync. Prefer constants, selectors, or memoization when the calculation is expensive. Ownership follows usage Find every component that needs the value. Place the…
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in