next.js
next.js copied to clipboard
Props in Dynamic Page is Undefined after using GetStaticProps and GetStaticPaths
Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System: Platform: win32 Arch: x64 Version: Windows 10 Pro Binaries: Node: 16.13.0 npm: N/A Yarn: N/A pnpm: N/A Relevant packages: next: 12.2.5 eslint-config-next: N/A react: 18.1.0 react-dom: 18.1.0
What browser are you using? (if relevant)
Version 103.0.5060.114
How are you deploying your application? (if relevant)
Vercel
Describe the Bug
I de-structured posts and tags from the props passed into the tags page component from the getStaticProps function, the posts and tags objects are returning undefined.
I tried using props.posts and props.tags respectively but it returned props undefined.
Expected Behavior
The props from the getStaticsProps function is be accessible in the tags page component where is de-structured its properties to be used in the page
Link to reproduction
https://github.com/idemmanuel001/fitness-blog/
To Reproduce
npm run build