Skip to content

Global state management: Update documentation

Created by: umpox

As part of https://github.com/sourcegraph/sourcegraph/issues/26655 we should add more documentation around using state:

  • Managing different types of state:
    • Global state: shared across the application and should be stored in a single Zustand store.
    • 'Localized' state: Will typically be used for things like reusable components, and may change depending on some configuration, should be stored in a normal React context. Example: Setting a compact state for all FilteredConnection UI components in a tree.
    • GraphQL state: Data fetched from our backend API, should be stored in the Apollo cache.
    • Local state: Normal React state that should be isolated in components, e.g. useState
  • FAQS
    • How to test
    • Common problems
    • ... etc