more formatting

This commit is contained in:
Christopher committed 2021-03-02 20:45:41 +01:00
1 parent 046447b0fb
commit f552c1212c
157 files changed
+635 -1579

No files matched your search

+1 -3
View File
@@ -10,9 +10,7 @@ import { useLocation } from 'react-router-dom';
*
* const { id, title } = useQueryParams<{ id: string, title: string }>();
*/
export function useQueryParams<T = Record<string, string>>(
defaultValues: T = null
) {
export function useQueryParams<T = Record<string, string>>(defaultValues: T = null) {
const query = qs.parse(useLocation().search, { ignoreQueryPrefix: true });
if (!defaultValues) {
return query as T & Partial<ParsedQs>;
+1 -1
View File
@@ -9,7 +9,7 @@ interface IRouterLocation {
export const addQueryToLocation = (
{ pathname = '', search = '' }: Record<string, unknown> & IRouterLocation,
key = '',
value = ''
value = '',
) => {
const { query } = url(pathname + search);
return `${pathname}?${qs.stringify({
@@ -8,7 +8,7 @@ interface IRouterLocation {
export const deleteQueryFromLocation = (
location: Record<string, unknown> & IRouterLocation,
key = ''
key = '',
) => {
const { query } = url(location.pathname + location.search);
return `${location.pathname}/?${qs.stringify({