--- description: Update React state by returning a new value. globs: "**/*.{ts,tsx}" alwaysApply: false --- # Immutable state - Do not push, splice, or assign into an object that is already in state. - Build the next array or object, then set state to that value. - For a click handler that updates a list, copy the list first. - If two screens show the same fact, they should read one store, not two copies that drift.