6.0.0-alpha.5
https://codesandbox.io/s/react-router-1w91e
call setParams() in a Container with an outlet.
search params are appended to the current path
search params replace the current path.
I assume this is because "*" doesn't actually pop any route segments - I'm struggling to find v5 docs that warn about this however.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
You can add the fresh label to prevent me from taking any action.
I am seeing this issue too. Pretty sure it is a bug...
Related to how navigate doesn't work on dynamic routes like foo/*.
@mjackson @ryanflorence can we reopen this issue?
EDIT: seeing this issue on v6.0.0-beta.0
I'm also seeing this unfortunately
So the work around is just doing
const location = useLocation();
...
navigate({
pathname: location.pathname,
search: "?" + createSearchParams({ ...newParams }),
});
The issue is that useSearchParams tries to navigate to the parent path (?) which breaks children paths
https://github.com/ReactTraining/react-router/blob/dev/packages/react-router-dom/index.tsx#L418
Most helpful comment
I am seeing this issue too. Pretty sure it is a bug...
Related to how
navigatedoesn't work on dynamic routes likefoo/*.