UNPKG

react-use-search-params-state

Version:

React hook to keep state using URL search params. Based on useSearchParams from react-router@7

10 lines (9 loc) 445 B
type DefaultType = string | number | boolean | Array<string | number | boolean> | null; type SearchParamStateType = { type: 'string' | 'number' | 'boolean'; default: DefaultType; multiple?: boolean; }; export type SearchParamsStateType = Record<string, SearchParamStateType>; export declare const useSearchParamsState: (paramsDefinition: SearchParamsStateType) => readonly [any, (newValues: Record<string, any>) => void]; export {};