import React from 'react'; import { Navigate, Route, useLocation } from 'react-router-dom'; export interface Redirect { from: string to: string } const RedirectWithSearch = ({ to }: { to: string }) => { const { search } = useLocation(); return ( ); }; export function toRedirectRoute({ from, to }: Redirect) { return ( } /> ); }