I have multiple routes in my webapp like normal. I have a few questions regarding the best ways to pass information down the chain since I can't really find a solid answer:
How would I pass what the current route is down to the children components? I have a global component that is used across every page of my webapp. On one of the page's, the content has to be different. The only way I can do this is by knowing what page is being served. Or am I thinking of this incorrectly and should just parse window.location on componentDidMount() to get everything I need?
This is kind of tied in to the above point. Let's say I have a parameterized route (/test/:id), and one of its child components needs to perform some ajax request when a button is clicked, and needs to pass in the :id to the endpoint. How would I be able to get this done?
Maybe I have to pass things down as properties starting from the route level all the way down?
I'm just trying to figure out what the best option is.
Thanks!