Hi, preparing a migration plan, I found out there seem to be a significant difference in how extra params (queryParams) are handled. By extra params I mean the parameters that are not explicitly specified in the route definition.
- In router-direct, all the params passed to the route, would end up in the “params” argument of canLoad:
/list/:category + /list/root?sort=name -> params: {category: root, sort: name}
- In router-lite, only the parameters that are explicitly defined in the route are passed:
/list/:category + /list/root?sort=name -> params: {category: root}
. The remaining are available vianext.queryParams: {sort: name}
I understand this is by design as stated here by @Sayan751 and frankly it does make sense to me.
However, since this is a migration scenario (and now that router-lite became the default router it might be quite common soon) I am wondering whether it might be possible to override the behavior and pass the combined params + queryParams for the sake of compatibility with router(-direct)?
I tried the lifecycleHooks but it seems params
is read-only there.