Skip to content

Instantly share code, notes, and snippets.

@VinayakHegde
Last active November 5, 2021 22:05
Show Gist options
  • Save VinayakHegde/88ccb76772760be8fdcaab92229e9246 to your computer and use it in GitHub Desktop.
Save VinayakHegde/88ccb76772760be8fdcaab92229e9246 to your computer and use it in GitHub Desktop.
export async function getStaticPaths() {
const paths = getAllPostIds();
return {
paths,
fallback: true,
};
}
// Simple fallback page example
function Post({ post }) {
const router = useRouter()
// If the page is not yet generated, this will be displayed
// initially until getStaticProps() finishes running
if (router.isFallback) {
return <div>Loading...</div>
}
// Render post...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment