Closed jensljungblad closed 8 years ago
I'd like to have a sample repo in this case.
Could you try this with the kadira:flow-router-ssr
instead of Flow Router?
New development is going there.
@arunoda Where can I find the docs for the SSR version? I suspect I need to turn off the actual SSR part since I'm using Blaze and not React..
Sorry, my mistake, I was running the router on the server as well as the client, hence the errors. Using the SSR branch seems to have solved the issue!
I have a sample repo. You can see the behaviour by console messages while switching within routes in first line. Please look at it. We first receiving old route param in new route, and then new one, but template helper already was called with bad data. https://github.com/krizka/flow-rerender/tree/master/client
so here we get situation, when FlowRouter.current().params.id == '1', and FlowRouter.getParam('id') == '2'
In addition to previous answer, wanted to say, that changing
const id = FlowRouter.getParam('id');
FlowRouter.watchPathChange();
const id = FlowRouter.current().params.id;
Working better and always returned right params values, but autorun called twice anyway.
@krizka I'll have a look on this.
Thanks. Sorry, can't deploy to meteor.com, it says 'temporary unavailable'.
Hey @krizka I can't find anything wrong your code. May be you should post a new issue with more info.
That's because the original issue of @jensljungblad is solved.
Ok. Thanks. I will try with new version and open new if not solved.
It is still there in 3.9.3. Will open new issue now. Please see in short time.
I have the following, most of which I grabbed from the Meteor Guide: http://guide.meteor.com/data-loading.html#organizing-subscriptions
Now, when
game.started
turns true, theautorun
executes theFlowRouter.go
. When this happens, apparentlyFlowRouter.getParam("_id")
becomes undefined, even before the new page has rendered. This leads mygame
helper to become undefined as well which leads to a bunch of crashes in my templates which expect there to be agame
context present.Is this a bug in FlowRouter or am I supposed to do this differently?