J
J
Jedi2019-03-02 17:07:12
React
Jedi, 2019-03-02 17:07:12

How to implement layout/views in React?

How would you implement work with layouts?
See, this is a regular AppComponent:

return (
    <div className="App">
      <header>
        <nav>
          <Link to="somewhere">Главная</Link>
        </nav>
      </header>
      <main>
        <Switch>
          <Route exact path="/" component={}/>
          <Route path="/somewhere" component={} />
        </Switch>
      </main>
    </div>
  );

I want to implement different View. For example, a notFound page should not display a NavigationBar(Menu) and footer.
How to implement it correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Magrian, 2019-03-02
@Magrian

another Switch with notFound at the root

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question