import React from 'react'; import { Route, Redirect } from 'react-router-dom'; import Authorized from './Authorized'; class AuthorizedRoute extends React.Component { render() { const { component: Component, render, authority, redirectPath, ...rest } = this.props; return ( } /> } > (Component ? : render(props)) } /> ); } } export default AuthorizedRoute;