Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

Been using a similar pattern for a long time in the Next.js, but now with the app router we can also add a loader function that's executed in a server component. (Thanks Ryan Florence for the inspiration) ✅ Infer/validate params/searchParams from Zod schema. ✅ Infer data

22,573 görüntüleme • 2 yıl önce •via X (Twitter)

10 Yorum

Eelco Wiersma profil fotoğrafı
Eelco Wiersma2 yıl önce

@ryanflorence Source code here:

Kyle Gill profil fotoğrafı
Kyle Gill2 yıl önce

That create page function looks 👌

Eelco Wiersma profil fotoğrafı
Eelco Wiersma2 yıl önce

Thanks Kyle!

Chris Ribeiro profil fotoğrafı
Chris Ribeiro2 yıl önce

@nextjs @ryanflorence Look nice! CreatePage is a public library?

Eelco Wiersma profil fotoğrafı
Eelco Wiersma2 yıl önce

@nextjs @ryanflorence Yeah will release it in the next days 👌

Renato Ribeiro profil fotoğrafı
Renato Ribeiro2 yıl önce

@nextjs @ryanflorence What happens if zod can't parse params/searchParams? It will pass down type as `z.infer<T> | undefined`, it will throw or it will show a pre-defined error ui page?

Eelco Wiersma profil fotoğrafı
Eelco Wiersma2 yıl önce

@nextjs @ryanflorence Right now it will throw and render error.tsx if it exists. But other options like a safe mode is also a consideration.

JB Hutch profil fotoğrafı
JB Hutch2 yıl önce

@nextjs @ryanflorence Ooh I like this!

Dale profil fotoğrafı
Dale2 yıl önce

@nextjs @ryanflorence Oh this is a great idea!

Chris Eagle profil fotoğrafı
Chris Eagle2 yıl önce

@nextjs @ryanflorence I like this

Benzer Videolar