Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Supporting navigation to / and basePath when basePath is defined #252

Merged
merged 4 commits into from
Feb 28, 2025

Conversation

upreeti
Copy link
Contributor

@upreeti upreeti commented Feb 27, 2025

The current issue is that when basePath is defined (e.g. /base), even when we pass in / and /base as routes to RRR, navigating to url.com/ or url.com/base results in a 404, because

  • / becomes /base/ and
  • /base becomes /base/base

when trying to find matching routes, and so now no routes match / or /base. This PR is making an update so that when the user is navigating to / or /base the base path is ignored and they become valid routes to match on. /base/ is still a valid route

Copy link

changeset-bot bot commented Feb 27, 2025

🦋 Changeset detected

Latest commit: e5cd5b2

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

This PR includes changesets to release 1 package
Name Type
react-resource-router Minor

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

@upreeti upreeti marked this pull request as ready for review February 28, 2025 00:06
liamqma
liamqma previously approved these changes Feb 28, 2025
@@ -0,0 +1,5 @@
---
"react-resource-router": patch
Copy link
Collaborator

Choose a reason for hiding this comment

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

To be safe it needs to be a minor I think. Although we've fixed a bug, we've also introduced a new behaviour - allow / if basePath is set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay will update

@liamqma liamqma merged commit bf5a671 into master Feb 28, 2025
3 checks passed
@liamqma liamqma deleted the support-navigation-without-basePath branch February 28, 2025 01:23
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants