Function useSearchParams

Returns an object representing the parsed search parameters from the current URL. The object will have the specified default values, which can be a partial object or a function that returns a partial object. The returned object will have the same properties as the default values, with values parsed from the URL search parameters.

  • Type Parameters

    • T = Record<string, Value>

      The type of the default values object.

    Parameters

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

      The default values object or function. Defaults to an empty object.

    • Optionalprefix: string = ""

      The prefix for search params if managing search

    Returns T

    • The parsed search parameters object.