-
-
Notifications
You must be signed in to change notification settings - Fork 926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Route query params change does not trigger remount #1757
Comments
If you want custom diff behavior on route change, you can use a RouteResolve. Here using a m.route(document.body, "/settings", {
"/settings": {
onmatch: function(){return Settings},
render: function(vnode){
var mode = m.route.param("mode") || '' // or vnode.attrs.mode
vnode.key = mode
return vnode
}
}
}); |
Thanks! It works as expected. But it looks like a temporary solution mostly. |
It was the default with v0.2, which provided If two routes point to different components, switching from one to the other will cause the view to be torn down and rebuilt. Not otherwise. It allows for example (using I suggest you read the new router docs to get an idea of what it offers... Edit: BTW, you're right, that's missing from the v0.2 migration guide. |
Thanks for explanation! Probably m.route(document.body,` "/", {
"<some route>": {
onmatch: function(){return RouteComponent},
render: function(vnode){
vnode.key = window.location.hash
return vnode
}
}
}); May help someone else. |
Closing due to age. |
Hello!
When hash with query params change
oninit
method is not called and page remains old despite view updates. Only page refresh helps. I suppose, when route change whole component should be recreated like default browser behavior, not just view.See example here: https://jsfiddle.net/a7uy9L5z/2/
The text was updated successfully, but these errors were encountered: