Closed watchingfun closed 7 months ago
The problem comes from the path being non deterministic. Both version are possible when coming from the string version and that shouldn’t be the case. You need to add something to differentiate them: a prefix, a custom regexp:
Reproduction
https://codesandbox.io/p/devbox/nervous-bird-q4d89n
Steps to reproduce the bug
Jump to the route with two parameters, one of which is empty; then jump to the new route; then router.back().
When I jump to A, the parameters are
{p1:'',p2:'p2'}
. When I return using router.back(), the parameters should be the same as when I jumped. In fact, it is{p1:'p2',p2:''}
Expected behavior
When I jump to A, the parameters are
{p1:'',p2:'p2'}
. When I return using router.back(), the parameters should be the same as when I jumped.Actual behavior
In fact, it is
{p1:'p2',p2:''}
Additional information
No response