![]() But, with the container, I can do it on the initial load and then check for a pathname change on properties change, and it behaves exactly as I want that way. I wound up doing it with the container because I could find no good place to do it anywhere in the page component itself (constructor would only log a page view the first time a page was loaded or reloaded from the server, and componentDidMount would log every time the page rerendered, giving, for example, three page view records when really the user only viewed the page once). And I need it because I'm using a container component around my routes to log page views to a database. I also find it totally counter-intuitive that match would not always show this. The issues section here is meant for bug reports. I don't actually know what you need the params in your header for, so I can't really give a recommendation on which approach is "best", but it's probably either a or b.Īlso, if you have any further usage questions, please use StackOverflow or Reactiflux since those communities are setup to answer questions. ![]() ![]() location = Ī) change up the structure of your components so that you are matching routes at a root level and then render the and components based on the matched routeī) have a second set of routes inside of your to figure out which route matchesĬ) use some context "magic" to get route components to report their params. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |