Skip to content

State Management

Jeremy Asuncion edited this page Jul 16, 2024 · 1 revision

We store all of our global state in URL parameters via the useSearchParams() hook in Remix. The benefit of this is it allows us to have global state + permalinks through one API. All query parameter keys are stored in the QueryParams enum in the app/constants/query.ts module.

Future of state management

In the future we may refactor our state to be stored in jotai, a global state management library using the atom pattern. Storing our state in useSearchParams() has performance implications that are described in https://github.com/chanzuckerberg/cryoet-data-portal/issues/879.

Clone this wiki locally