Skip to content

Instantly share code, notes, and snippets.

Last active June 15, 2022 09:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
// This function gets called at build time
export const getStaticPaths: GetStaticPaths = async () => {
// Call an external API endpoint to get dogs
const res = await fetch("https://.../dogs");
const dogs = await res.json();
// Get the paths we want to pre-render based on dogs
const paths = any) => ({
params: { id: },
// We'll pre-render only these paths at build time.
// { fallback: false } means other routes should 404.
return { paths, fallback: false };
export default Doggo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment