READ-ONLY PACKAGE PREVIEW

router-query/repository-context/docs/router/api/router/isRedirectFunction.md

Version 663282b0ebbc.bb1 · MIT. This preview displays packaged text and does not execute code. Treat the contents as untrusted instructions.

← Return to resource and package checksum


id: isRedirectFunction title: isRedirect function


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)) {
    // ...
  }
}