-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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 linking path #10708
Fix linking path #10708
Conversation
Hey ercote! Thanks for opening your first pull request in this repo. If you haven't already, make sure to read our contribution guidelines. |
✅ Deploy Preview for react-navigation-example ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR
@satya164 @ercote this change resets the navigation state if the app is redirected from another app. IMO root URL ("" or /) deeplink should be handled when app is opened first time, if it's already opened then it should not reset the navigation state. I can do a PR. Let me know if this is expected. You can check the below video to see the usecase. Navigation resets on redirection from another app. RPReplay_Final1664352656.MP4 |
Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro. |
Motivation
At the moment, a linking url without a path (with or without an ending slash) cannot match the linking configuration, as it is ignored.
Consider the following linking configuration:
If the received linking url is equal to
https://myapp.com/
it won't be matchingMyScreen
as the empty path is ignore. To be able to match an empty path, we need to change the path validation (see change inuseLinking.native.tsx
).The
getStateFromPath
function is already able to match an empty string. Tests have been added to clearly expose the expected behaviour.Test plan
Use a deeplink url without a path in your app and match that deeplink in your linking configuration using an empty path.