Open chmac opened 8 years ago
Maybe I should add, if I call FlowRouter.go()
from the console, the problem does not happen. We're calling it from a submit button's onClick()
callback, and then the problem happens.
Also, the browser's address bar has already updated by the time that the FlowRouter.getQueryParam()
call returns undefined
so we could probably workaround by reading window.location
, although that seems pretty ugly...
Further investigation shows that FlowRouter.current().queryParams.foo
has the correct value, but somehow .getQueryParam()
returns undefined
. At least we have an easy workaround...
Having the same issue after changing to flow-router-ssr
. Thanks your workaround saved me some digging.
We have a search form on the homepage. The user enters some value, we store that in the component's state. Then the user clicks
Submit
and we do:Then in the component that's rendered by
route
we do this:In this case,
foo
isundefined
. The result ofgetQueryParam()
isundefined
at that point. Likewise in thecomponentDidMount()
callback. This was not the case withflow-router
, only once we changed toflow-router-ssr
to workaround #379.