The Redirect type is used to represent a redirect action in TanStack Router.
export type Redirect = {
statusCode?: number
throw?: any
headers?: HeadersInit
} & NavigateOptions
export type Redirect = {
statusCode?: number
throw?: any
headers?: HeadersInit
} & NavigateOptions
The Redirect object accepts/contains the following properties:
Since Redirect extends NavigateOptions, it also supports navigation properties:
Important: For external URLs, always use the href property instead of to. The to property is designed for internal navigation within your application.
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.