Configuration

typedRoutes configuration

Enables typed route checking in TypeScript projects. Does not validate runtime input or authorization. Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/typedRoutes

Formal Syntax & Structure

nextjs syntaxnextjs
typedRoutes: true

Working Example

Example Snippetnextjs
// next.config.tsimport type {NextConfig} from 'next';const config: NextConfig = {typedRoutes: true, cacheComponents: false};export default config;
Next.js Reference