I want a list to be hidden from the user if the url is not '/'. This list renders at the top level and consists of many links. Whenever I navigate back to '/' (index route) I want to show the list again. How can I use reach router most effectively to listen to this location and change the state accordingly so I can hide/show my article list and hide/show the article with the appropriate path?
I tried using the navigation component and played around with the LocationProvider component but am currently stuck. The below component is wrapped in a Router with path '/*'
<div>
<Header />
<div className='App'>
<Slide
direction='right'
in={true}
timeout={{
appear: 0,
enter: 400,
exit: 0
}}
mountOnEnter
unmountOnExit>
<List>{getArticlesList()}</List>
</Slide>
</div>
<Router>{getArticles()}</Router>
</div>