remove conditional redirect component

This commit is contained in:
Jake McDermott
2019-01-02 01:15:31 -05:00
parent 18505b35b8
commit a2601d5f67
3 changed files with 76 additions and 137 deletions

View File

@@ -1,23 +0,0 @@
import React from 'react';
import {
Route,
Redirect
} from 'react-router-dom';
const ConditionalRedirect = ({
component: Component,
shouldRedirect,
redirectPath,
location,
...props
}) => (shouldRedirect() ? (
<Redirect to={{
pathname: redirectPath,
state: { from: location }
}}
/>
) : (
<Route {...props} render={rest => (<Component {...rest} />)} />
));
export default ConditionalRedirect;