Const
A redirect Response that will perform a history.replaceState instead of a history.pushState for client-side navigation redirects. Sets the status code and the Location header. Defaults to 302 Found.
Response
history.replaceState
history.pushState
Location
302 Found
import { replace } from "react-router";export async function loader() { return replace("/new-location");}@public Copy
import { replace } from "react-router";export async function loader() { return replace("/new-location");}@public
framework
data
The URL to redirect to.
The status code or a ResponseInit object to be included in the response.
ResponseInit
A Response object with the redirect status and Location header.
A redirect
Responsethat will perform ahistory.replaceStateinstead of ahistory.pushStatefor client-side navigation redirects. Sets the status code and theLocationheader. Defaults to302 Found.