Skip to main content

isRedirect function

还没翻译译自英文(tanstack.com)本页 9 段都还没译

The isRedirect function can be used to determine if an object is a redirect object.

isRedirect options

The isRedirect function accepts a single argument, an input.

input

  • Type: unknown
  • Required
  • An object to check if it is a redirect object

isRedirect returns

  • Type: boolean
  • true if the object is a redirect object
  • false if the object is not a redirect object

Examples

import { isRedirect } from '@tanstack/react-router'

function somewhere(obj: unknown) {
  if (isRedirect(obj)) {
    // ...
  }
}