Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

Statically typed links are coming to Next.js: ◆ Autocompletion ◆ Error on invalid routes ◆ Prevents 404 links during build ◆ Dynamic, catch-all, and optional catch-all routes ◆ Works with both `pages` and `app` ◆ No extra configuration needed!

278,585 görüntüleme • 3 yıl önce •via X (Twitter)

11 Yorum

Shu profil fotoğrafı
Shu3 yıl önce

TypeScript error with hints if you made a typo:

Shu profil fotoğrafı
Shu3 yıl önce

Autocompletion for static links when editing:

Shu profil fotoğrafı
Shu3 yıl önce

Dynamic routes with parameters:

Shu profil fotoğrafı
Shu3 yıl önce

Catch-all and optional catch-all routes are supported too:

Tanner Linsley profil fotoğrafı
Tanner Linsley3 yıl önce

@nextjs Nice!

Fernando Rojo profil fotoğrafı
Fernando Rojo3 yıl önce

@nextjs can this work with custom link components too, or only those imported from next/link?

Shu profil fotoğrafı
Shu3 yıl önce

@nextjs (Deleted my previous reply as I got it wrong) For custom components you will have to type it with a `Route` type, imported from Next.js, instead of using `string`. And then it will just work!

Julius profil fotoğrafı
Julius3 yıl önce

@nextjs Very niceeee!!!

Steven Tey profil fotoğrafı
Steven Tey3 yıl önce

@nextjs This is a gamechanger 🤯

victor profil fotoğrafı
victor3 yıl önce

@nextjs Interesting — how will this work? How would Typescript know about file system? Is the dev server compiling types while using fs?

Shu profil fotoğrafı
Shu3 yıl önce

@nextjs Yes, type declarations will be generated by the dev server

Benzer Videolar