Function useSearchParams

Hook to get and set URL search parameters.

  • Type Parameters

    • T

      The type of the URL parameters.

    Returns {
        clearParams: <TKey extends string | number | symbol>(
            ...keys: TKey[],
        ) => void;
        params: T;
        setParam: <TKey extends string | number | symbol, TValue>(
            key: TKey,
            value: TValue,
        ) => void;
    }

    An object containing the current URL parameters and a function to set a parameter.