在index.js文件中的next.js中反应路由器4

时间:2019-06-27 19:09:00

标签: reactjs next.js

但是在路由后,如果页面刷新,则index.js中建立的基本组件不会像ResetCSS组件那样再次呈现,请帮帮我。

<BrowserRouter history={history}>
            <ThemeProvider theme={appTheme}>
              <>
                <Head>
                  <title>Roots And Leaves</title>
                  <meta name="Description" content="React next landing page" />
                  <meta name="theme-color" content="#ec5555" />
                  <link
                    href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700"
                    rel="stylesheet"
                  />
                </Head>

                <ResetCSS />
                <GlobalStyle />

                <AppWrapper>
                  <Sticky top={0} innerZ={9999} activeClass="sticky-nav-active">
                    <DrawerProvider>
                      <Navbar />
                    </DrawerProvider>
                  </Sticky>
                  <Route exact path="/" component={Home} />
                  <Route exact path="/home" component={Home} />
                  <Route exact path="/faq" component={FAQ} />
                  <Route exact path="/about" component={About} />
                  <Route exact path="/popc" component={PopC} />
                  <Route exact path="/blog" component={Blog} />
                  <Route exact path="/policy" component={Policy} />
                  <Route exact path="/career" component={Career} />
                  <Route exact path="/contact" component={Contact} />
                  <Footer />
                </AppWrapper>
              </>
            </ThemeProvider>
          </BrowserRouter>

0 个答案:

没有答案