0
我試圖用孩子的路線內只有與反應路由器-DOM我無法訪問this.props.childre所以我就是這麼做的:使用反應路由器-DOM兒童
Index.js:
<Router>
<div>
<Route exact path="/" component={App}/>
<Route path="/login" component={Login}/>
<Route path="/forgot-password" component={ForgotPassword}/>
<Route path="/register" component={Register}/>
<Route path="/bank-account" component={BankAccount}/>
</div>
</Router>
App.js:
<Router>
<div className="uk-offcanvas-content">
<Header store={this.context.store}/>
<main className="wt-main">
<SideBar/>
<Route exact path="/" component={Dashboard} />
<Route exact path="/historic" component={Historic}/>
<Route exact path="/profile" component={Profile} profile={profile}/>
<Route exact path="/receivable" component={Receivable}/>
<Route exact path="/operators" component={Operators}/>
<Route exact path="/create-operator" component={CreateOperator}/>
</main>
<footer>
</footer>
<SideBarResponsive/>
</div>
的問題是,當我嘗試訪問內部路由s通過瀏覽器它出現一個空白頁面,但如果我訪問鏈接或重定向它正常工作