N
N
Nikita Shchypylov2018-02-06 14:41:24
React
Nikita Shchypylov, 2018-02-06 14:41:24

How to set up routing here using react-router-dom?

Hello everyone
There is a similar project:
5a79941706ebc335137429.jpeg
The red zone should be repeated, and the blue one should change. For red, I have two components, and for blue, I have different others.
I am using react-router-dom. You can re-render everything together every time, but this is stupid.
That is, routing only affects the blue zone

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2018-02-06
@Nikulio

The names are up to you, the idea is something like this. The rest depends on the code style you have adopted and the organization of the styles (RSCSS, BEM, SMACSS, ...)

<Root>
  <Sidebar />
  <Main>
    <Navbar />
    <Content>
      <Switch>
        <Route ... />
      </Switch>
    </Content>
  </Main>
</Root>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question