Custom hook useSearchState for managing search state in the URL.

  • Type Parameters

    • T extends Record<string, Value>

      Type of the search state object.

    Parameters

    • OptionaldefaultValues: Partial<T> | () => Partial<T>

      Default values for the search state object.

    • Optionalconfig: ISearchStateConfig

      The config for search state behaviour

    Returns readonly [T, any]

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