Files
Rocketplan/src/routes/RedirectRoute.tsx
T

20 lines
405 B
TypeScript
Raw Normal View History

2022-11-26 01:23:44 -05:00
/* eslint-disable */
import { Redirect, Route } from 'react-router-dom';
import React from 'react';
export const RedirectRoute = ({ children, redirect = '/login', ...rest }) => {
return (
<Route
{...rest}
render={({ location }) => (
<Redirect
to={{
pathname: redirect,
state: { from: location },
}}
/>
)}
/>
);
};