Skip to content

Instantly share code, notes, and snippets.

@estebanmunchjones2019
Created April 1, 2021 16:03
Show Gist options
  • Save estebanmunchjones2019/714eb1e89b94e6243cf02add08f9d028 to your computer and use it in GitHub Desktop.
Save estebanmunchjones2019/714eb1e89b94e6243cf02add08f9d028 to your computer and use it in GitHub Desktop.
// this code belongs to some dynamic route page, like /products/:id
export async function getStaticPaths() {
// some back end code here
return {
paths: [
{ params: { ... } }
],
fallback: true or false
};
}
// Here is an example of the shape of the data that must be returned by this function:
return {
paths: [
{ params: { id: '1' } },
{ params: { id: '2' } }
],
fallback: ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment