Declarative search param masking is lagging
I'm trying to use declarative route masking to clean up the url by not showing default search params. Navigating to my list page I want the user to see
example.com/list
and not example.com/list?page=1&search=&sortBy=date&sortOrder=asc&status=active&...
.
https://codesandbox.io/p/devbox/tsr-search-masking-question-vcds2n
A simplified example is this route mask:
Now when using navigate
the seach state updates correctly, but the url is lagging by one step i.e. clicking next at page 1 brings me to page 2, but the url doesn't update. Clicking next again brings me to page 3 and updates the url to page=2.
I would think that the navigation should happen and then the route mask should be applied, but it seems to me like the route mask is being applied before the navigation. How can I fix this/what am I doing wrong?
Thank you :^)0 Replies