Skip to content

Conversation

@vezaynk
Copy link
Contributor

@vezaynk vezaynk commented Aug 15, 2025

Fixing two inconsistencies.

  • navigate currently returns a Promise<void> | void. This could simply bePromise<void>.
  • setSearchParams calls navigate but swallows the promise, making it impossible to handle navigation aborts via .catch()

@changeset-bot
Copy link

changeset-bot bot commented Aug 15, 2025

⚠️ No Changeset found

Latest commit: fe56f9b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vezaynk vezaynk force-pushed the sk/feat/navigate-promise branch from 073a786 to 92321e6 Compare August 15, 2025 17:59
@vezaynk vezaynk force-pushed the sk/feat/navigate-promise branch from 92321e6 to fe56f9b Compare August 15, 2025 18:01
@vezaynk vezaynk changed the title feat(react-router): Make navigate and setSearchParams consistently return a Promise<void> feat(react-router): Make navigate and setSearchParams consistently return a Promise<void> Aug 15, 2025
@brophdawg11
Copy link
Contributor

These a breaking changes so we can't merge them. The navigate return type is correct because it differs based on the type of router you are using - there's a lengthy discussion in #12348 with the details.

We made the change to navigate change in a major version because it was a breaking change so we can't do the same for setSearchParams in a minor

@vezaynk
Copy link
Contributor Author

vezaynk commented Aug 15, 2025

@brophdawg11 would you consider this if it were gated behind an overload flag? It would make it non-breaking but still expose the functionality.

@brophdawg11
Copy link
Contributor

Do you want to open a proposal (new feature process) and if it gets enough traction we can consider it?

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.

2 participants