Navigate does not clear search by default #242
Replies: 2 comments 4 replies
-
Can you make a codesandbox we can debug together? |
Beta Was this translation helpful? Give feedback.
-
Here's an example: https://stackblitz.com/edit/react-ts-qjykxk?file=List.tsx From a consistency perspective it makes sense that when I suppose we could create wrappers for Maybe it would be enough if the behavior was documented a bit more clearly. And by the way, we're big fans of React Query and now also React Location. Thank you so much for these libraries! |
Beta Was this translation helpful? Give feedback.
-
I'm not sure this is a bug or an intentional change. I did not find any mention about it in the release notes. When upgrading from 3.3.4 to 3.7.0, I noticed that search params are no longer cleared when calling
navigate
without asearch
property.For example:
will preserve the search params while
will clear them.
The same thing happens with
Link
without asearch
prop.This caused some unexpected behavior in our app.
My assumption would be that search params would be cleared unless explicitly preserved with:
Beta Was this translation helpful? Give feedback.
All reactions