first commit
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
/* 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 },
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user