Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 2.27 KB

File metadata and controls

15 lines (12 loc) · 2.27 KB

Dynamic Route extreme

by 0753 @0753Ljuc

Take the Challenge

Given below routes, infer its dynamic params.

Route Params Type Definition
/blog/[slug]/page.js { slug: string }
/shop/[...slug]/page.js { slug: string[] }
/shop/[[...slug]]/page.js { slug?: string[] }
/[categoryId]/[itemId]/page.js { categoryId: string, itemId: string }
/app/[...foo]/[...bar] never - It's ambiguous as we cannot decide if b on /app/a/b/c is belongs to foo or bar.
/[[...foo]]/[slug]/[...bar] never
/[first]/[[...foo]]/stub/[...bar]/[last] { first: string, foo?: string[], bar: string[], last: string }

Back Share your Solutions Check out Solutions