Saturday, April 23, 2016

Meteor FlowRouter Reloading/Refreshing when changing URL

Leave a Comment

I've just recently switched from Iron Router to FlowRouter because of the same issue. I seem to be running into the problem with FlowRouter as well.

I have an app layout that looks something like:

<template name="appLayout">     {{> menu}}     {{> Template.dynamic template=content}}     {{> footer}} </template> 

Whenever I use the template helper <a href="{{pathFor 'profileView' id=user._id}}"></a> or <a href="{{pathFor 'home'}}"></a> in my menu template, the entire app doesn't refresh or reload, it loads the template fine, we're good. It seems the issue arises when a pathFor is clicked in a template that's been loaded within the {{> Template.dynamic template=content}}. How can I prevent the app from refreshing or reloading when trying to load these other templates? Why is it happening just from templates that are loading within the {{> Template.dynamic template=content}}?

Also, I use this flow-router-helpers package that provides useful helpers (like pathFor) for FlowRouter. It was mentioned in the kadira docs.

EDIT

Okay, so I created a new Meteor project and tested a {{pathFor}} link inside the {{> Template.dynamic template=content}} and everything works fine. I've tried removing packages, css, and js to see if any of those are causing the reload and that didn't work. I have no idea why it would be refreshing while trying to load a template within the {{> Template.dynamic template=content}} but I don't believe it's a FlowRouter issue. Any ideas on how to debug this?

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment