Docs
CodeRabbit
Cloudflare
Railway
WorkOS
OpenRouter
Netlify
AG Grid
Clerk
SerpAPI
Sentry
Prisma
Unkey
Electric
CodeRabbit
Cloudflare
Railway
WorkOS
OpenRouter
Netlify
AG Grid
Clerk
SerpAPI
Sentry
Prisma
Unkey
Electric
Integrations

HistoryState interface

The HistoryState interface is an interface exported by the history package that describes the shape of the state object that can be used in conjunction with the history package and the window.location API.

You can extend this interface to add additional properties to the state object across your application.

tsx
// src/main.tsx
declare module '@tanstack/react-router' {
  // ...

  interface HistoryState {
    additionalRequiredProperty: number
    additionalProperty?: string
  }
}
// src/main.tsx
declare module '@tanstack/react-router' {
  // ...

  interface HistoryState {
    additionalRequiredProperty: number
    additionalProperty?: string
  }
}