Docs
CodeRabbit
Cloudflare
Railway
SerpAPI
Netlify
OpenRouter
Clerk
AG Grid
WorkOS
Sentry
Prisma
Electric
Unkey
CodeRabbit
Cloudflare
Railway
SerpAPI
Netlify
OpenRouter
Clerk
AG Grid
WorkOS
Sentry
Prisma
Electric
Unkey
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
  }
}