Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

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 Aufrufe • vor 3 Jahren •via X (Twitter)

11 Kommentare

Profilbild von Shu
Shuvor 3 Jahren

TypeScript error with hints if you made a typo:

Profilbild von Shu
Shuvor 3 Jahren

Autocompletion for static links when editing:

Profilbild von Shu
Shuvor 3 Jahren

Dynamic routes with parameters:

Profilbild von Shu
Shuvor 3 Jahren

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

Profilbild von Tanner Linsley
Tanner Linsleyvor 3 Jahren

@nextjs Nice!

Profilbild von Fernando Rojo
Fernando Rojovor 3 Jahren

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

Profilbild von Shu
Shuvor 3 Jahren

@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!

Profilbild von Julius
Juliusvor 3 Jahren

@nextjs Very niceeee!!!

Profilbild von Steven Tey
Steven Teyvor 3 Jahren

@nextjs This is a gamechanger 🤯

Profilbild von victor
victorvor 3 Jahren

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

Profilbild von Shu
Shuvor 3 Jahren

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

Ähnliche Videos