Updating Store Before Custom Route
问题 I am designing react application with node server. I have created a custom Private Route import React from 'react'; import {connect} from 'react-redux'; import {Route, Redirect} from 'react-router-dom'; class PrivateRoute extends React.Component{ render() { const { isAuthenticated, component: Component, ...rest } = this.props; return ( <Route {...rest} component={(props) => { if(isAuthenticated){ return <Component {...props}/> } else{ return <Redirect to="/login" /> } }}/> ) } } const