Last active
November 5, 2021 22:05
-
-
Save VinayakHegde/88ccb76772760be8fdcaab92229e9246 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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