-
Notifications
You must be signed in to change notification settings - Fork 26
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
#281 Fix url search query params #282
base: main
Are you sure you want to change the base?
Conversation
…he url search params
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -12,35 +11,38 @@ export const limitBounds = { | |||
export type LimitBound = (typeof limitBounds)[keyof typeof limitBounds]; | |||
|
|||
export type UsePaginationReturn = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you forgot to rename the Interface to also match the new hook's name
cc: @nevendyulgerov
updateQueryParams(keyword); | ||
onChange(keyword); | ||
}, [query, onChange, keyword, updateQueryParams]); | ||
if (lastSearch.current !== query) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if that useEffect
is necessary and if the logic ever runs because of how the onSearch
callback is defined below. I believe the effect is fired as expected, but I guess that if
is never evaluated to true.
cc: @nevendyulgerov
I deprecated the custom hooks
useQueryParams
andusePaginationParams
and unified their logic into a new custom hook -useUrlSearchParams
where all three params (page
,limit
,query
) are being handled.