Docs Archive Docs Archive Home React TypeScript Next.js Contact
CTRL K
    GitHub
    CTRL K
      • Blog
        • Best Web Hosting
      • Next.js
        • Next.js 13.5
          • Using App Router
            • Getting Started
              • Installation
              • Project Structure
            • Building Your Application
              • Routing
                • Defining Routes
                • Pages and Layouts
                • Linking and Navigating
                • Route Groups
                • Loading UI and Streaming
                • Error Handling
                • Parallel Routes
                • Route Handlers
                • Middleware
              • Data Fetching
                • Data Fetching Patterns
                • Forms and Mutations
              • Rendering
                • Client Components
                • Composition Patterns
                • Edge and Node.js Runtimes
              • Caching
              • Styling
                • Tailwind CSS
                • CSS-in-JS
                • Sass
              • Optimizing
                • Images
                • Metadata
                • Static Assets
                • OpenTelemetry
                • Instrumentation
              • Configuring
                • TypeScript
                • ESLint
                • Environment Variables
                • Absolute Imports and Module Path Aliases
                • MDX
                • Draft Mode
                • Content Security Policy
              • Deploying
              • Upgrading
                • Codemods
                • App Router Migration
            • API Reference
              • Components
                • Font
                • <Image>
                • <Link>
              • File Conventions
                • error.js
                • layout.js
                • loading.js
                • not-found.js
                • route.js
                • Metadata Files
                  • favicon, icon, and apple-icon
                  • opengraph-image and twitter-image
                  • robots.txt
                  • sitemap.xml
              • Functions
                • cookies
                • draftMode
                • generateImageMetadata
                • generateMetadata
                • generateStaticParams
                • headers
                • ImageResponse
                • NextRequest
                • NextResponse
                • notFound
                • permanentRedirect
                • revalidatePath
                • revalidateTag
                • Server Actions
                • useReportWebVitals
                • useSearchParams
                • useSelectedLayoutSegment
                • useSelectedLayoutSegments
              • next.config.js Options
                • appDir
                • assetPrefix
                • basePath
                • compress
                • devIndicators
                • distDir
                • env
                • eslint
                • exportPathMap
                • generateBuildId
                • generateEtags
                • headers
                • httpAgentOptions
                • images
                • incrementalCacheHandlerPath
                • mdxRs
                • onDemandEntries
                • optimizePackageImports
                • output
                • pageExtensions
                • productionBrowserSourceMaps
                • reactStrictMode
                • redirects
                • rewrites
                • serverComponentsExternalPackages
                • transpilePackages
                • turbo
                • typedRoutes
                • typescript
                • urlImports
                • webpack
                • webVitalsAttribution
              • create-next-app
              • Next.js CLI
            • Architecture
              • Accessibility
              • Fast Refresh
              • Next.js Compiler
              • Supported Browsers
            • Community
          • Using Pages Router
            • Getting Started
              • Installation
              • Project Structure
            • Building Your Application
              • Routing
                • Pages and Layouts
                • Dynamic Routes
                • Linking and Navigating
                • Custom App
                • Custom Document
                • Custom Errors
                • Internationalization
                • Authenticating
                • Middleware
              • Rendering
                • Server-side Rendering (SSR)
                • Static Site Generation (SSG)
                • Incremental Static Regeneration (ISR)
                • Automatic Static Optimization
                • Client-side Rendering (CSR)
                • Edge and Node.js Runtimes
              • Data Fetching
                • getStaticProps
                • getStaticPaths
                • Forms and Mutations
                • Incremental Static Regeneration
                • Client-side Fetching
              • Styling
                • CSS Modules
                • Tailwind CSS
                • CSS-in-JS
                • Sass
              • Optimizing
                • Images
                • Fonts
                • Scripts
                • Lazy Loading
                • Analytics
                • OpenTelemetry
                • Instrumentation
                • Testing
              • Configuring
                • TypeScript
                • ESLint
                • Environment Variables
                • Absolute Imports and Module Path Aliases
                • AMP
                • Babel
                • PostCSS
                • Custom Server
                • Draft Mode
                • Error Handling
                • Preview Mode
                • Content Security Policy
              • Deploying
                • Going to Production
                • Static Exports
                • Multi Zones
              • Upgrading
                • Codemods
                • From Pages to App
                • Version 12
                • Version 11
                • Version 10
                • Version 9
            • API Reference
              • Components
                • Font
                • <Head>
                • <Link>
                • <Script>
                  • Props
                  • Required Props
                  • Optional Props
                  • Version History
              • Functions
                • getInitialProps
                • getServerSideProps
                • getStaticPaths
                • getStaticProps
                • useAmp
                • useReportWebVitals
                • useRouter
              • next.config.js Options
                • assetPrefix
                • basePath
                • compress
                • devIndicators
                • distDir
                • env
                • eslint
                • exportPathMap
                • generateBuildId
                • generateEtags
                • headers
                • httpAgentOptions
                • images
                • onDemandEntries
                • output
                • pageExtensions
                • poweredByHeader
                • productionBrowserSourceMaps
                • reactStrictMode
                • redirects
                • Runtime Config
                • trailingSlash
                • transpilePackages
                • turbo
                • typescript
                • urlImports
                • webpack
                • webVitalsAttribution
              • create-next-app
              • Edge Runtime
            • Architecture
              • Accessibility
              • Fast Refresh
              • Next.js Compiler
              • Supported Browsers
            • Community
      • React
        • Latest version ↗
        • React 18.1
          • Installation
            • Getting Started
            • Add React to a Website
            • Create a New React App
            • CDN Links
            • Release Channels
          • Main Concepts
            • 1. Hello World
            • 2. Introducing JSX
            • 3. Rendering Elements
            • 4. Components and Props
            • 5. State and Lifecycle
            • 6. Handling Events
            • 7. Conditional Rendering
            • 8. Lists and Keys
            • 9. Forms
            • 10. Lifting State Up
            • 11. Composition vs Inheritance
          • Advanced Guides
            • Accessibility
            • Code-Splitting
            • Context
            • Error Boundaries
            • Forwarding Refs
            • Fragments
            • Higher-Order Components
            • Integrating with Other Libraries
            • JSX In Depth
            • Optimizing Performance
            • Portals
            • Profiler
            • React Without ES6
            • React Without JSX
            • Reconciliation
            • Refs and the DOM
            • Render Props
            • Static Type Checking
            • Strict Mode
            • Typechecking With PropTypes
            • Uncontrolled Components
            • Web Components
          • API Reference
            • React
            • ReactDOM
            • ReactDOMClient
            • ReactDOMServer
            • DOM Elements
            • SyntheticEvent
            • Test Utilities
            • Test Renderer
            • JS Environment Requirements
            • Glossary
          • Hooks
            • 1. Introducing Hooks
            • 2. Hooks at a Glance
            • 3. Using the State Hook
            • 4. Using the Effect Hook
            • 5. Rules of Hooks
            • 6. Building Your Own Hooks
            • 7. Hooks API Reference
            • 8. Hooks FAQ
          • Testing
            • Testing Overview
            • Testing Recipes
            • Testing Environments
          • Contributing
            • How to Contribute
            • Codebase Overview
            • Implementation Notes
            • Design Principles
          • FAQ
            • AJAX and APIs
            • Babel, JSX, and Build Steps
            • Passing Functions to Components
            • Component State
            • Styling and CSS
            • File Structure
            • Versioning Policy
            • Virtual DOM and Internals
      • TypeScript
        • Latest version (5.3) ↗
        • TypeScript 5.2
          • Get Started
            • TS for the New Programmer
            • TypeScript for JS Programmers
            • TS for Java/C# Programmers
            • TS for Functional Programmers
            • TypeScript Tooling in 5 minutes
          • Handbook
            • The TypeScript Handbook
            • The Basics
            • Everyday Types
            • Narrowing
            • More on Functions
            • Object Types
            • Type Manipulation
              • Creating Types from Types
              • Generics
              • Keyof Type Operator
              • Typeof Type Operator
              • Indexed Access Types
              • Conditional Types
              • Mapped Types
              • Template Literal Types
            • Classes
            • Modules
          • Reference
            • Utility Types
            • Decorators
            • Declaration Merging
            • Enums
            • Iterators and Generators
            • JSX
            • Mixins
            • Namespaces
            • Namespaces and Modules
            • Symbols
            • Triple-Slash Directives
            • Type Compatibility
            • Type Inference
            • Variable Declaration
          • Modules Reference
            • Introduction
            • Theory
            • Guides
              • Choosing Compiler Options
            • Reference
            • Appendices
              • ESM/CJS Interoperability
          • Tutorials
            • ASP.NET Core
            • Gulp
            • DOM Manipulation
            • Migrating from JavaScript
            • Using Babel with TypeScript
          • What's New
            • TypeScript 5.2
            • TypeScript 5.1
            • TypeScript 5.0
            • TypeScript 4.9
            • TypeScript 4.8
            • TypeScript 4.7
            • TypeScript 4.6
            • TypeScript 4.5
            • TypeScript 4.4
            • TypeScript 4.3
            • TypeScript 4.2
            • TypeScript 4.1
            • TypeScript 4.0
            • TypeScript 3.9
            • TypeScript 3.8
            • TypeScript 3.7
            • TypeScript 3.6
            • TypeScript 3.5
            • TypeScript 3.4
            • TypeScript 3.3
            • TypeScript 3.2
            • TypeScript 3.1
            • TypeScript 3.0
            • TypeScript 2.9
            • TypeScript 2.8
            • TypeScript 2.7
            • TypeScript 2.6
            • TypeScript 2.5
            • TypeScript 2.4
            • TypeScript 2.3
            • TypeScript 2.2
            • TypeScript 2.1
            • TypeScript 2.0
            • TypeScript 1.8
            • TypeScript 1.7
            • TypeScript 1.6
            • TypeScript 1.5
            • TypeScript 1.4
            • TypeScript 1.3
            • TypeScript 1.1
          • Declaration Files
            • Introduction
            • Declaration Reference
            • Library Structures
            • .d.ts Templates
              • Modules .d.ts
              • Module: Plugin
              • Module: Class
              • Module: Function
              • Global .d.ts
              • Global: Modifying Module
            • Do's and Don'ts
            • Deep Dive
            • Publishing
            • Consumption
          • JavaScript
            • JS Projects Utilizing TypeScript
            • Type Checking JavaScript Files
            • JSDoc Reference
            • Creating .d.ts Files from .js files
          • Project Configuration
            • What is a tsconfig.json
            • Compiler Options in MSBuild
            • tsc CLI Options
            • Project References
            • Integrating with Build Tools
            • Configuring Watch
            • Nightly Builds
        • TypeScript 5.1
          • Get Started
            • TS for the New Programmer
            • TypeScript for JS Programmers
            • TS for Java/C# Programmers
            • TS for Functional Programmers
            • TypeScript Tooling in 5 minutes
          • Handbook
            • The TypeScript Handbook
            • The Basics
            • Everyday Types
            • Narrowing
            • More on Functions
            • Object Types
            • Type Manipulation
              • Creating Types from Types
              • Generics
              • Keyof Type Operator
              • Typeof Type Operator
              • Indexed Access Types
              • Conditional Types
              • Mapped Types
              • Template Literal Types
            • Classes
            • Modules
          • Reference
            • Utility Types
            • Decorators
            • Declaration Merging
            • Enums
            • Iterators and Generators
            • JSX
            • Mixins
            • ECMAScript Modules in Node.js
            • Modules
            • Module Resolution
            • Namespaces
            • Namespaces and Modules
            • Symbols
            • Triple-Slash Directives
            • Type Compatibility
            • Type Inference
            • Variable Declaration
          • Tutorials
            • ASP.NET Core
            • Gulp
            • DOM Manipulation
            • Migrating from JavaScript
            • Using Babel with TypeScript
          • What's New
            • TypeScript 5.1
            • TypeScript 5.0
            • TypeScript 4.9
            • TypeScript 4.8
            • TypeScript 4.7
            • TypeScript 4.6
            • TypeScript 4.5
            • TypeScript 4.4
            • TypeScript 4.3
            • TypeScript 4.2
            • TypeScript 4.1
            • TypeScript 4.0
            • TypeScript 3.9
            • TypeScript 3.8
            • TypeScript 3.7
            • TypeScript 3.6
            • TypeScript 3.5
            • TypeScript 3.4
            • TypeScript 3.3
            • TypeScript 3.2
            • TypeScript 3.1
            • TypeScript 3.0
            • TypeScript 2.9
            • TypeScript 2.8
            • TypeScript 2.7
            • TypeScript 2.6
            • TypeScript 2.5
            • TypeScript 2.4
            • TypeScript 2.3
            • TypeScript 2.2
            • TypeScript 2.1
            • TypeScript 2.0
            • TypeScript 1.8
            • TypeScript 1.7
            • TypeScript 1.6
            • TypeScript 1.5
            • TypeScript 1.4
            • TypeScript 1.3
            • TypeScript 1.1
          • Declaration Files
            • Introduction
            • Declaration Reference
            • Library Structures
            • .d.ts Templates
              • Modules .d.ts
              • Module: Plugin
              • Module: Class
              • Module: Function
              • Global .d.ts
              • Global: Modifying Module
            • Do's and Don'ts
            • Deep Dive
            • Publishing
            • Consumption
          • JavaScript
            • JS Projects Utilizing TypeScript
            • Type Checking JavaScript Files
            • JSDoc Reference
            • Creating .d.ts Files from .js files
          • Project Configuration
            • What is a tsconfig.json
            • Compiler Options in MSBuild
            • tsc CLI Options
            • Project References
            • Integrating with Build Tools
            • Configuring Watch
            • Nightly Builds
      • Next.js 13.5
        • Using App Router
          • Getting Started
            • Installation
            • Project Structure
          • Building Your Application
            • Routing
              • Defining Routes
              • Pages and Layouts
              • Linking and Navigating
              • Route Groups
              • Loading UI and Streaming
              • Error Handling
              • Parallel Routes
              • Route Handlers
              • Middleware
            • Data Fetching
              • Data Fetching Patterns
              • Forms and Mutations
            • Rendering
              • Client Components
              • Composition Patterns
              • Edge and Node.js Runtimes
            • Caching
            • Styling
              • Tailwind CSS
              • CSS-in-JS
              • Sass
            • Optimizing
              • Images
              • Metadata
              • Static Assets
              • OpenTelemetry
              • Instrumentation
            • Configuring
              • TypeScript
              • ESLint
              • Environment Variables
              • Absolute Imports and Module Path Aliases
              • MDX
              • Draft Mode
              • Content Security Policy
            • Deploying
            • Upgrading
              • Codemods
              • App Router Migration
          • API Reference
            • Components
              • Font
              • <Image>
              • <Link>
            • File Conventions
              • error.js
              • layout.js
              • loading.js
              • not-found.js
              • route.js
              • Metadata Files
                • favicon, icon, and apple-icon
                • opengraph-image and twitter-image
                • robots.txt
                • sitemap.xml
            • Functions
              • cookies
              • draftMode
              • generateImageMetadata
              • generateMetadata
              • generateStaticParams
              • headers
              • ImageResponse
              • NextRequest
              • NextResponse
              • notFound
              • permanentRedirect
              • revalidatePath
              • revalidateTag
              • Server Actions
              • useReportWebVitals
              • useSearchParams
              • useSelectedLayoutSegment
              • useSelectedLayoutSegments
            • next.config.js Options
              • appDir
              • assetPrefix
              • basePath
              • compress
              • devIndicators
              • distDir
              • env
              • eslint
              • exportPathMap
              • generateBuildId
              • generateEtags
              • headers
              • httpAgentOptions
              • images
              • incrementalCacheHandlerPath
              • mdxRs
              • onDemandEntries
              • optimizePackageImports
              • output
              • pageExtensions
              • productionBrowserSourceMaps
              • reactStrictMode
              • redirects
              • rewrites
              • serverComponentsExternalPackages
              • transpilePackages
              • turbo
              • typedRoutes
              • typescript
              • urlImports
              • webpack
              • webVitalsAttribution
            • create-next-app
            • Next.js CLI
          • Architecture
            • Accessibility
            • Fast Refresh
            • Next.js Compiler
            • Supported Browsers
          • Community
        • Using Pages Router
          • Getting Started
            • Installation
            • Project Structure
          • Building Your Application
            • Routing
              • Pages and Layouts
              • Dynamic Routes
              • Linking and Navigating
              • Custom App
              • Custom Document
              • Custom Errors
              • Internationalization
              • Authenticating
              • Middleware
            • Rendering
              • Server-side Rendering (SSR)
              • Static Site Generation (SSG)
              • Incremental Static Regeneration (ISR)
              • Automatic Static Optimization
              • Client-side Rendering (CSR)
              • Edge and Node.js Runtimes
            • Data Fetching
              • getStaticProps
              • getStaticPaths
              • Forms and Mutations
              • Incremental Static Regeneration
              • Client-side Fetching
            • Styling
              • CSS Modules
              • Tailwind CSS
              • CSS-in-JS
              • Sass
            • Optimizing
              • Images
              • Fonts
              • Scripts
              • Lazy Loading
              • Analytics
              • OpenTelemetry
              • Instrumentation
              • Testing
            • Configuring
              • TypeScript
              • ESLint
              • Environment Variables
              • Absolute Imports and Module Path Aliases
              • AMP
              • Babel
              • PostCSS
              • Custom Server
              • Draft Mode
              • Error Handling
              • Preview Mode
              • Content Security Policy
            • Deploying
              • Going to Production
              • Static Exports
              • Multi Zones
            • Upgrading
              • Codemods
              • From Pages to App
              • Version 12
              • Version 11
              • Version 10
              • Version 9
          • API Reference
            • Components
              • Font
              • <Head>
              • <Link>
              • <Script>
            • Functions
              • getInitialProps
              • getServerSideProps
              • getStaticPaths
              • getStaticProps
              • useAmp
              • useReportWebVitals
              • useRouter
            • next.config.js Options
              • assetPrefix
              • basePath
              • compress
              • devIndicators
              • distDir
              • env
              • eslint
              • exportPathMap
              • generateBuildId
              • generateEtags
              • headers
              • httpAgentOptions
              • images
              • onDemandEntries
              • output
              • pageExtensions
              • poweredByHeader
              • productionBrowserSourceMaps
              • reactStrictMode
              • redirects
              • Runtime Config
              • trailingSlash
              • transpilePackages
              • turbo
              • typescript
              • urlImports
              • webpack
              • webVitalsAttribution
            • create-next-app
            • Edge Runtime
          • Architecture
            • Accessibility
            • Fast Refresh
            • Next.js Compiler
            • Supported Browsers
          • Community

      On this page

      • Props
      • Required Props
      • src
      • Optional Props
      • strategy
      • beforeInteractive
      • afterInteractive
      • lazyOnload
      • worker
      • onLoad
      • onReady
      • onError
      • Version History
      Edit this page on GitHub →
      Next.js
      Next.js 13.5
      Using Pages Router
      API Reference
      Components
      <Script>