Skip to content

Instantly share code, notes, and snippets.

Avatar

Chad Johnson chaddjohnson

  • Neato Web Solutions LLC
  • Grand Rapids, MI
View GitHub Profile
@chaddjohnson
chaddjohnson / FavoriteRecipesPage.js
Last active Nov 16, 2020
React Pagination Example Using Hooks
View FavoriteRecipesPage.js
import React, { useState } from 'react';
import { useRouter } from 'next/router';
const FavoriteRecipesPage = () => {
const { router } = useRouter();
const [page, setPage] = useState(router.query.page);
const [pageSize, setPageSize] = useState(router.query.pageSize);