Suggest an editImprove this articleRefine the answer for “How does local state differ from global state?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Local state** is data needed by only one component, while **global state** is data used in multiple places across the application and must be shared. **Key point:** local is about "here and now", global is about "everyone knows it, always".Shown above the full answer for quick recall.Answer (EN)Image**Local state** is data needed **only by one component**. **Global state** is data that is **used in multiple places across the application** and must be shared. --- ### Local state: - Lives inside the component (`this.counter = 0`) - Does not affect other parts of the application - Resets when the component is destroyed - Convenient for small things: modals, flags, temporary values **Example:** A "show password" flag in an input is purely local state. --- ### Global state: - Stored in services, stores (NgRx, Akita) - Accessible from different components - Lives as long as the application does - Used to manage user data, settings, authentication, and so on **Example:** The current user's data, the cart, catalog filters, the interface language. --- **Conclusion:** Local is about "here and now", global is about "everyone knows it, always". The bigger the application, the more important it is to keep them clearly separated.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.