私のアプリにreact-router
v4
を使用しています。ここに私ですroutes.js
:ネストされたルートが動作しないのはなぜですか? ReactRouter4
const routes = (
<Route
path="/"
render={props => (
<App>
<Switch>
<Route exact path="/" component={Home} />
<Route path="/org/:slug" component={Org} />
<Route exact path="/test" component={Test} />
<Route exact path="*" component={Error.NotFound} />
</Switch>
</App>
)}
/>
);
すべてのルートが正常に動作します。 Org
コンポーネントでは、私はルートの別のセットがあります。
export default() => (
<LookUp>
<Switch>
<Route path="/login" component={LogIn} />
<Route path="/create-account" component={CreateAccount} />
<Route path="/request-password" component={Auth.Request} />
<Route path="reset-password" component={Auth.Reset} />
</Switch>
</LookUp>
);
を私は非常に簡単ですLookUp
コンポーネントでrender
機能を打っています:
render() {
return <div>{this.props.children}</div>
}
私はレンダリングにブレークポイントを置くことができます機能はchildren
を参照してください。 Switch
子はの4つすべてがSwitch
の子として存在しますが、私はOrg
ファイル内のいずれのルートにもルーティングしません。私は間違って何をしていますか?