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

fix: Dynamic keys for useQueryStates #858

Open
wants to merge 2 commits into
base: next
Choose a base branch
from
Open

Conversation

franky47
Copy link
Member

@franky47 franky47 commented Jan 13, 2025

Tasks

  • Add a unit test (probably doesn't need e2e)

Closes #799.

Copy link

vercel bot commented Jan 13, 2025

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

Name Status Preview Comments Updated (UTC)
nuqs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 16, 2025 2:24pm

Copy link

pkg-pr-new bot commented Jan 13, 2025

Open in Stackblitz

npm i https://pkg.pr.new/nuqs@858

commit: ff2570f

@franky47 franky47 marked this pull request as ready for review January 14, 2025 04:29
@franky47 franky47 requested a review from Copilot January 14, 2025 04:29

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

packages/nuqs/src/useQueryStates.test.ts:296

  • The expectation for result.current[0].d should be consistent with other checks. It should be expect(result.current[0].d).toBeUndefined().
expect(result.current[0].d).toBeNull()

packages/nuqs/src/useQueryStates.ts:116

  • Comparing the joined strings of keys and values is unconventional and error-prone. Consider comparing the lengths of the arrays instead.
Object.keys(queryRef.current).join('&') !== Object.values(resolvedUrlKeys).join('&')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic keys in useQueryStates
2 participants