Update to latest frontend-kit

This commit is contained in:
Alejandro Celaya
2024-07-22 18:33:35 +02:00
parent 7039e11f3f
commit fa10aebeab
4 changed files with 50 additions and 69 deletions

View File

@@ -1,13 +1,7 @@
import { parseQuery } from '@shlinkio/shlink-frontend-kit';
import { useCallback, useMemo } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import { useCallback } from 'react';
import { useNavigate } from 'react-router-dom';
export const useGoBack = () => {
const navigate = useNavigate();
return useCallback(() => navigate(-1), [navigate]);
};
export const useParsedQuery = <T>(): T => {
const { search } = useLocation();
return useMemo(() => parseQuery<T>(search), [search]);
};