这是我的 app.jsx,我想访问app.jsisAdmin
的状态...确定用户是否为管理员并基于值..我想操纵路线....我怎么能做到这一点? ?Login Component
isAdmin
请帮助我是新来的反应...
import Login from './components/Forum/login';
console.log("login",Login.this.state.isAdmin);
ReactDOM.render(
<Router history={browserHistory}>
<Route path="/" component={Base}>
<IndexRoute component={isAdmin == true ? DashboardV1 : ChartFlot } />
<Route path="dashboard" component={DashboardV1}/>
<Route path="dashboardv2" component={DashboardV2}/>
<Route path="dashboardv3" component={DashboardV3}/>
<Route path="form-cropper" component={FormCropper}/>
</Router>,
document.getElementById('app')
);