Function useSearchState

Custom hook useSearchState for managing search state in the URL.

  • Type Parameters

    • T extends Record<string, Value>

      Type of the search state object.

    Parameters

    • defaultValues: Partial<T> | (() => Partial<T>) = {}

      Default values for the search state object.

    • config: ISearchStateConfig = {}

      The config for search state behaviour

    Returns readonly [T, Dispatch<SetStateAction<T>>]

    • An array containing the search state object and a function to update the search state.