-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle path with empty string properly for linking (#10708)
**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: ``` { prefixes: ['https://myapp.com/'], config: { screens: { MyScreen: '', }, }, }; ``` If the received linking url is equal to `https://myapp.com/` it won't be matching `MyScreen` as the empty path is ignore. To be able to match an empty path, we need to change the path validation (see change in `useLinking.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.
- Loading branch information
Showing
3 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters