So I been working on one of my first projects in meteor and I am using FlowRouter. However I am running across a little issue where when they click the link to go to their profile it will go to the link but requires a refresh to get it to show their pallets they submitted. Here is a gif of the issue. If anyone could help or point me in the right direction that would be great.
I did some research and it looks like this behaviour is intentional. @arunoda had the following to say in this GitHub issue:
We are doing some checks on FlowRouter.go to stop running route if called multiple times. Which means routes are idempotent.
if I’m in domain.com/posts/1234 and want to route over to domain.com/posts/5678, only the URL will get updated but no redirection actually takes place. Is there any way to accomplish this without requiring a complete refresh? Seems like a super common use case…
I don’t really understand your question. You don’t need to use reload() when navigating to another URL. Just listen to the URL in your template with Flowrouter.getParam(‘id’). Subscribe to the correct data and render it in the template.
Read the guide and look at the source for the Todo app associated with the guide, you will soon understand how they handle routing, subscriptions and data in templates.
Ok I figured this out. Once I switched from using TrackerReact to createContainer everything magically works. Previously, I had to (as per your suggestion) wrap the constructor in Tracker.autorun, which seemed too much like an anti-pattern for my liking. Cheers!