I have 3 routes that use the same component and based on the route display slightly different content. The problem is that on every route change the whole components mounts/unmounts from scratch leading to performance issues. What is the best way to avoid the unmounting but still use the same component and have these 3 routes?
<Route path="/Products" exact render={Products} />
<Route path="/Products/shoes" exact component={Products} />
<Route path="/Products/books" exact component={Products} />
React Router version 4.
<Route path="/Products/:type?" exact render={Products} />and see if it mounts/unmounts each time ?