DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
Next.js Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
hard
Next.js
A [locale] segment should only ever be 'en', 'fr', or 'de'. What's the recommended way to enforce this?
A
Rely on TypeScript's string type alone
B
Runtime-validate the value (e.g. with a type assertion function) and call notFound() for anything outside the known set, narrowing the type afterward
C
It's not possible to narrow this
D
Use a regex in next.config.ts
Check Answer