Is it possible to use once a component for all routes with NextJS

  javascript, next.js, react-router, reactjs, routes

I’m beginner on NextJS
My problem is simple : I just want to know if is it possible to do this with NextJS

// with react-router-dom
<Router>
    <>
        <Header />
        <Switch>
          <Route path="/">
                <Home />
            </Route>
            <Route path="/about">
                <About />
            </Route>
            <Route path="/users">
                <Users />
            </Route>
        </Switch>
    </>
</Router>

I wish to have <Header /> in all my pages without rendering each time I change page

Currently I call my header in each page but there is reinitialization of the props.

Source: Ask Javascript Questions

LEAVE A COMMENT