Suggest an editImprove this articleRefine the answer for “Why is it important to avoid duplicating state?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)Because **duplicated state = a source of bugs**, always. **Key point:** duplicated state is a trap for the mind and for bugs; the fewer places where data lives, the cleaner, simpler, and more reliable everything works.Shown above the full answer for quick recall.Answer (EN)ImageBecause **duplicated state = a source of bugs**. Always. --- ### What happens when you duplicate: - **You change one value and forget the other** - The UI shows one thing while the logic thinks another - It's unclear which of the copies is "the real one" - Manual synchronization becomes necessary - Bugs happen "seemingly at random" --- ### Example: You store a `products` list and a separate `filteredProducts` list. Then you update `products`, but forget to update `filteredProducts` - the screen shows stale data. --- ### How to avoid it: - Use **derived state** whenever something can be computed - Keep a single **source of truth** - Never store a "copy for convenience" without a good reason --- **Conclusion:** Duplicated state is a **trap for the mind and for bugs**. The fewer places where data lives, the cleaner, simpler, and more reliable everything works.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.