N
N
newsiberian2016-02-09 14:41:23
React
newsiberian, 2016-02-09 14:41:23

How to make a reusable Sidebar with react-router?

Greetings, tell me how you can do the following:
There is a top-level Layout component, for now it just forwards children below. You need to somehow screw a sidebar into this business, and it should also forward different components depending on the route. For example, in the admin panel we display some forms in this panel, in blogs in the same panel there is already completely different content.
In this case, the panel can be hidden/opened. I also want to do this through the route (QueryString). I look at the react-router examples, but what I see there is somehow not quite right, or maybe I don’t understand something.
The problem is that all these admins, blogs, and so on are modules, maybe even other packages, and I still don’t understand how I can combine components from other, say, modules, in parallel with the usual content (children) into a working scheme.
Does anyone have any ideas, or may be faced with a similar problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
newsiberian, 2016-02-09
@newsiberian

I'll expand the question. Here is the behavior described here . We can pass a group of components like this:
But this only works for passing to the parent. Is it possible to somehow pass the components up the route chain to the root component in the same way?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question