Skip to content

Conversation

@kyrregjerstad
Copy link

Summary

Adds documentation warning that schema fields using .optional() without explicit defaults will be silently ignored and cannot update the URL.

Why

useSearchParams extracts field information by validating an empty object against the schema. Fields without defaults won't appear in the validation result, so the hook doesn't recognize them as valid parameters for URL updates.

This caused me some headache when params.fieldName = value silently failed to update the URL.

@changeset-bot
Copy link

changeset-bot bot commented Dec 23, 2025

🦋 Changeset detected

Latest commit: c10636b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
runed Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant