clearOnDefault in custom parser #1341
Replies: 3 comments 1 reply
|
Likely this: The point of the eq function, for non-primitive types (like Date here), is to be able to check the value you set against the default value. By returning false, it can never detect this and therefore never clears it from the URL. |
0 replies
|
@franky47 what about the other simple one. it was straight forward: const [randomValues] = useQueryStates({
foo: parseAsString
.withDefault('foo-value')
.withOptions({ clearOnDefault: false }),
bar: parseAsString
.withDefault('bar-value')
.withOptions({ clearOnDefault: false }),
});
i actually want it to be shown in the url always, changed/default doesn't matter. but it doesn't show in url at all until i change. i know i can use useEffect but that comes with another cost as i have to fire an api call on dateRange change. |
1 reply
|
thanks for answers 🥂 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
what wrong i am doing here. i want to show default value in the url. when i change value it does get reflected but not on defualt value.
https://stackblitz.com/edit/vitejs-vite-dgxziane?file=src%2FApp.tsx
All reactions