Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
needed to render only the first matching route from the list. If not, then all routes that match the passed conditions will be rendered.
<Switch>
<Route path="/" component={A} /> // <-- будет отрендерен только этот роут
<Route path="/" component={A} />
</Switch>
<>
<Route path="/" component={A} /> // <-- будет отрендерен этот роут
<Route path="/" component={A} /> // <-- и этот так же будет отрендерен
</>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question