-
-
Notifications
You must be signed in to change notification settings - Fork 256
fix: make sure the state-change effect runs for multi parsers #1163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
72ede72
7d9f9ba
10e5630
db8de3f
7222c22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,10 +153,15 @@ export function useQueryStates<KeyMap extends UseQueryStatesKeysMap>( | |
| setInternalState(state) | ||
| } | ||
| queryRef.current = Object.fromEntries( | ||
| Object.values(resolvedUrlKeys).map(urlKey => [ | ||
| urlKey, | ||
| initialSearchParams?.get(urlKey) ?? null | ||
| ]) | ||
| Object.entries(resolvedUrlKeys).map(([key, urlKey]) => { | ||
| const parser = keyMap[key] | ||
| return [ | ||
| urlKey, | ||
| parser?.type === 'multi' | ||
| ? initialSearchParams?.getAll(urlKey) | ||
| : (initialSearchParams?.get(urlKey) ?? null) | ||
| ] | ||
| }) | ||
|
Comment on lines
-156
to
+164
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here, I’m trying to address a caching issue where we were putting the wrong values into the Now, we are reading with @franky47 I’m not really sure how / where to add a test for this. I did add an e2e test for issue #1162
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah the e2e test should be enough for this, thanks! |
||
| ) | ||
| } | ||
|
|
||
|
|
@@ -182,7 +187,7 @@ export function useQueryStates<KeyMap extends UseQueryStatesKeysMap>( | |
| } | ||
| }, [ | ||
| Object.values(resolvedUrlKeys) | ||
| .map(key => `${key}=${initialSearchParams?.get(key)}`) | ||
| .map(key => `${key}=${initialSearchParams?.getAll(key)}`) | ||
| .join('&'), | ||
| JSON.stringify(queuedQueries) | ||
| ]) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.