在页脚上反应路由器渲染页面

时间:2020-04-08 02:29:42

标签: reactjs react-router create-react-app react-router-dom

每次我重定向时,React Router都会在页面底部的页脚中一直加载我的页面。有什么建议吗?

<Provider store={store}>
  <Router>
    <Nav />
    <Switch>
      <Route exact path='/' component={Home} />
      <Route exact path='/login' component={Login} />
      <Route exact path='/register' component={Register} />
      <Route exact path='/dashboard' component={Dashboard} />
      <Route exact path='/subscriptions' component={Subscriptions} />
      <Route exact path='/newPost' component={NewPost} />
    </Switch>
    <Footer />
  </Router>
</Provider>

0 个答案:

没有答案