一个重定向 Response
,它将执行 history.replaceState
而不是 history.pushState
来进行客户端导航重定向。它会设置状态码和 Location
响应头。默认为 302 Found
。
import { replace } from "react-router";
export async function loader() {
return replace("/new-location");
}
要重定向到的 URL。
要包含在响应中的状态码或 ResponseInit
对象。