当我的导航栏加载并且我完全失去时,我收到了上述警告,但感觉我错过了一些明显的东西。
我正在使用react(15.0.2),react-router(2.0.0),react-stormpath(1.1.0),stormpath(0.16.0)
Navbar组件:
<nav className="navbar navbar-default navbar-fixed-top" >
<div className="container">
<div id="navbar-collapse" className="collapse navbar-collapse" >
<div className="navbar-header">
<Link className="navbar-brand" to="/">Title Logo</Link>
</div>
<ul className="nav navbar-nav" >
<Authenticated inGroup="admin" >
<li><Link to="/createCourse">Create Event</Link></li>
</Authenticated>
<Authenticated>
<li><Link to="/findEvents">Find Event</Link></li>
</Authenticated>
<Authenticated>
<li><Link to="/about">About</Link></li>
</Authenticated>
</ul>
<ul className="nav navbar-nav navbar-right">
<NotAuthenticated>
<li><span className="glyphicon glyphicon-log-in"></span><LoginLink /></li>
</NotAuthenticated>
<NotAuthenticated>
<li><span className="glyphicon glyphicon-user"></span><Link to="/register">Create Account</Link></li>
</NotAuthenticated>
<Authenticated>
<li><LogoutLink /></li>
</Authenticated>
</ul>
</div>
</div>
</nav>
路由器:
<Router history={browserHistory} >
<HomeRoute path="/" component={MasterPage} >
<IndexRoute component={home} />
<LoginRoute path="/login" component={LoginPage} />
<Route path="/register" component={RegistrationPage} />
<AuthenticatedRoute inGroup="admin" path="/createCourse" component={AppIndex} />
<AuthenticatedRoute><Route path="/findEvents" component={FindEvents} /></AuthenticatedRoute>
<Route path="/about" component={About} />
<AuthenticatedRoute><Route path="/event/:id" component={AppIndex} /></AuthenticatedRoute>
</HomeRoute>
</Router>
我的导航栏组件是否需要覆盖setRouteLeaveHook函数?这需要在我的路由器中完成吗?
答案 0 :(得分:0)
这看起来像React-Router和Stormpath-React SDK的不兼容问题。我要调查一下。
干杯!
罗宾