Next.js 13 Update | Episode #3 | generateStaticParams & generateMetaData

preview_player
Показать описание
Today we learn how to create dynamic routes and statically generate the content inside of them, as well as generate our metadata object.

Рекомендации по теме
Комментарии
Автор

Thanks for posting this. That was clever how to show a 404 page without having to set dynamicParams to false.

mygelbergstresser
Автор

Great video, just what I was looking for. Subscribed!

jealouscase
Автор

awesome video! thank you for explaining this

mluu
Автор

Super helpful dude! Like this serie. Thanks!

ferenochsoames
Автор

this is so useful. I'm still new to nextjs, i'm just wondering since generateStaticParams creates the params at build time, how do we generate new static pages when we add new posts via a headless cms, for example?

eternl_sunshine
Автор

You don't have to make multiple calls to firebase in generateStaticParams, page and generateMetaData. You can create a util to fetch the blog and cache its result so that you don't unnecessarily make multiple calls.

import {cache} from "react" should be used if fetch is not used to cache the result

bhaveshchaudhari
Автор

in my project when i go to a page which doest exist it returns a server error instead of 404.. I saw on GH issues that next only does this in development and will 404 after build but I'd love to know why yours seems to 404 correctly


Error: Page "/[slug]/page" is missing param "/wrong" in "generateStaticParams()", which is required with "output: export" config.

"next": "14.1.4",

MrWilLeighton
Автор

Why dont you explain what is the reason of writing these things? You only write and end the video. Where is the tutorial part?

mrscicikus