const PrivateRoute = ({ component: Component, ...rest }) => (
<Route
{...rest}
render={props =>
fakeAuth.isAuthenticated ? (
<Component {...props} />
) : (
<Redirect
to={{
pathname: "/login",
state: { from: props.location }
}}
/>
)
}
/>
);
(在下看不懂上面这种的写法)
请问上面的写法如何翻译成 class App extends Component {...}
这种写法?
https://reacttraining.com/react-router/web/example/auth-workflow