E
E
Eugene2020-07-05 17:24:19
React
Eugene, 2020-07-05 17:24:19

How to pass an element inside the Route, which has another component file in the parameters?

How to pass an element inside the Route, which has another component file in the parameters? There are no errors, but in the dom tree, there is none :P
Lines: 42 and 16. Thanks.
5f01e275a8c4a979326801.png
5f01e27584d84133842597.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Eugene, 2020-07-06
@toohappy

I did everything right, you need to pass it as <AutoexpertCard/>, and everything is displayed in the dom tree.
The problem was with the class itself. For some reason, in React, the 'ads' class does not display the layout. Very strange.

V
Vladimir, 2020-07-05
@ruvasik

Well, for starters, understand what you are transmitting and what you want to display.
You pass the component to the InfoPage component with the child.
props.children– reserved property of nested component elements

L
lnked, 2020-07-06
@lnked

<Route exact path="/info-expert" component={() => <InfoPage><AutoexpertCard /></InfoPage> } />

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question