Skip to content

Instantly share code, notes, and snippets.

View chaddjohnson's full-sized avatar

Chad Johnson chaddjohnson

  • Grand Rapids, MI
View GitHub Profile
@chaddjohnson
chaddjohnson / FavoriteRecipesPage.js
Last active November 16, 2020 02:20
React Pagination Example Using Hooks
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);