这是我在App.js
中的主要路由器页面:
<Provider store={store}>
<Router>
<Switch>
<Route exact path = "/" component= {FormPage}></Route>
<Route path = "/dashboard" component= {Dashboard}></Route>
</Switch>
</Router>
</Provider>
并且在仪表板页面:
<Router>
<Switch>
<Route path = "/register" component= {Registration}></Route>
<Route path = "/home" component= {Home}></Route>
</Switch>
</Router>
在注册或主页中刷新后,没有任何显示。但是App.js
文件中的路由工作正常。
<Router>
<Switch>
<Route path = "/dashboard/register" component= {Registration}>
</Route>
<Route path = "/dashboard/home" component= {Home}></Route>
</Switch>
</Router>