mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-24 23:19:39 -05:00
14 lines
282 B
TypeScript
14 lines
282 B
TypeScript
import { useNavigate } from "@remix-run/react";
|
|
import type { To } from "history";
|
|
import * as React from "react";
|
|
|
|
export function Redirect({ to }: { to: To }) {
|
|
const navigate = useNavigate();
|
|
|
|
React.useEffect(() => {
|
|
navigate(to);
|
|
}, [navigate, to]);
|
|
|
|
return null;
|
|
}
|