Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nevendyulgerov
Copy link
Contributor

I deprecated the custom hooks useQueryParams and usePaginationParams and unified their logic into a new custom hook - useUrlSearchParams where all three params (page, limit, query) are being handled.

@nevendyulgerov nevendyulgerov added Type: Bug Something isn't working apps: web labels Dec 16, 2024
@nevendyulgerov nevendyulgerov self-assigned this Dec 16, 2024
Copy link

vercel bot commented Dec 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rollups-explorer-arbitrum-mainnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 4:38pm
rollups-explorer-arbitrum-sepolia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 4:38pm
rollups-explorer-base-mainnet 🛑 Canceled (Inspect) Dec 16, 2024 4:38pm
rollups-explorer-base-sepolia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 4:38pm
rollups-explorer-mainnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 4:38pm
rollups-explorer-optimism-mainnet 🛑 Canceled (Inspect) Dec 16, 2024 4:38pm
rollups-explorer-optimism-sepolia 🛑 Canceled (Inspect) Dec 16, 2024 4:38pm
rollups-explorer-sepolia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 4:38pm
rollups-explorer-workshop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 4:38pm

@@ -12,35 +11,38 @@ export const limitBounds = {
export type LimitBound = (typeof limitBounds)[keyof typeof limitBounds];

export type UsePaginationReturn = [
Copy link
Collaborator

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) {
Copy link
Collaborator

@brunomenezes brunomenezes Dec 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apps: web Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigation issues when using input search in conjunction with pagination
2 participants