Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const TestComponent = () => {
const { response, error, loading } = useQuery(exampleAction());
const { fetch, response: paginatedResponse } = usePaginatedQuery(
examplePaginatedQuery,
[1],
);
const [page, setPage] = useState(1);
return (
<span>
{error && 'error'}
{loading && 'loading'}
{response && 'response'}
{paginatedResponse && paginatedResponse.length}
<button> {
fetch([page + 1]);</button></span>