react-navigation / react-navigation/react-navigation
web: URL changes back and forth
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 24.5k
- Forks
- 5.1k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 18
Description
Current Behavior
I noticed a strange behaviour when using the library in the browser. When navigating to a different route the URL changes back and forth:

I assume it's related to this part because if I comment this it works as expected:
https://github.com/react-navigation/react-navigation/blob/main/packages/native/src/useLinking.tsx#L186
which is called by
https://github.com/react-navigation/react-navigation/blob/main/packages/native/src/useLinking.tsx#L493
Expected Behavior
The URL should stay and not change to the previous again.
How to reproduce
Unfortunately, I was not able to reproduce the issue in a small example. Maybe it happens when the Promise in go takes longer than expected.
Your Environment
| software | version |
|---|---|
| iOS or Android | web (Chrome) |
| @react-navigation/native | 5.7.3 |
| react-native | via expo |
| expo | 38.0.10 |
| node | 14.7.0 |
| npm or yarn | yarn |
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/native/src/useLinking.tsx at the referenced lines 186 and 493, and investigate browser navigation with a delayed go Promise. Establish a reproducible case, then verify that navigating to a different route leaves the URL at the new route rather than reverting to the previous one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, react-native, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100