beautiful-react-hooks
Version:
A collection of beautiful (and hopefully useful) React hooks to speed-up your components and hooks development
10 lines (9 loc) • 403 B
TypeScript
export interface UseQueryParamOptions<TValue extends string> {
initialValue?: TValue;
replaceState?: boolean;
}
/**
* Ease the process of modify the query string in the URL for the current location.
*/
declare const useQueryParam: <TValue extends string>(key: string, options?: UseQueryParamOptions<TValue>) => [TValue, (nextValue?: TValue | undefined) => void];
export default useQueryParam;