We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent caec137 commit 91b4993Copy full SHA for 91b4993
packages/use-query-params/src/updateSearchString.ts
@@ -121,7 +121,9 @@ export function updateSearchString({
121
};
122
123
if (navigate) {
124
- if (updateType?.startsWith('replace')) {
+ // be defensive about checking updateType since it is somewhat easy to
125
+ // accidentally pass a second argument to the setter.
126
+ if (typeof updateType === 'string' && updateType.startsWith('replace')) {
127
adapter.replace(newLocation);
128
} else {
129
adapter.push(newLocation);
0 commit comments