I am learning react and have a background in angular and have checked the docs and seen a tutorial about routing with react. In angular you can programatically route to components by geting an instance of the router and then calling
router.navigate(['/myroute'])
I feel like there has to be somthing similar in react, but have seen the docs and do not seen this. Ive just seen references to created a <Redirect />
component. I would much prefer to programatically route because I assumed one could do this when created a
<Switch><Route /> <Route /> ... etc </Switch>
So how does one programatically route to components in a similar way that one does with the above angular example?