UnhandledLinkingContext throws while linking is not ready (!isLinkingReady branch omits providers)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react-native, typescript
- Domain
- mobile
Research direction
Start in lib/module/NavigationContainer.js at the !isLinkingReady early-return branch, then compare it with the main return path and its UnhandledLinkingContext.Provider and LinkingContext.Provider values. Ensure the fallback uses the same linking-related providers and remains inside ThemeProvider; done means consumers no longer hit the throwing default context during pre-resolution renders.
Written by the indexing model from the issue text.
Description
Problem
While NavigationContainer is in the “linking not ready” path (!isLinkingReady), it only renders LocaleDirContext + core ThemeProvider + fallback. It does not mount UnhandledLinkingContext.Provider or LinkingContext.Provider.
UnhandledLinkingContext’s default value throws if anything accesses lastUnhandledLink or setLastUnhandledLink. That can surface as:
Error: Couldn't find an UnhandledLinkingContext context.
during that window or when the gate flips again (e.g. toggling appearance / re-renders with async linking, portaled UI inside the container, etc.).
Expected behavior
Whenever NavigationContainer mounts (including the pre-resolution fallback branch), the same linking-related context values that exist after isLinkingReady should be available so consumers never hit the default context that throws.
Suggested fix
In the !isLinkingReady return path, wrap fallback with the same UnhandledLinkingContext.Provider and LinkingContext.Provider (and values unhandledLinkingContext / linkingContext) as in the main return, then keep ThemeProvider + fallback inside that tree.
Environment
@react-navigation/native: 7.x (e.g. 7.1.26)- React Native / Expo as applicable
Workaround
We applied a local patch-package change to lib/module/NavigationContainer.js to add those providers around the early-return branch.
- Dominant language
- TypeScript
- Stars
- 24.5k
- Forks
- 5.1k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 18
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.
More from react-navigation/react-navigation
-
needs repro
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
react-navigation/react-navigation#13234 · 2 comments ·
-
bug needs repro platform:android platform:ios
Difficulty 1/5 Under an hour Newbie friendliness 86/100
react-navigation/react-navigation#13219 · 5 comments ·
-
repro provided
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
react-navigation/react-navigation#13210 · 3 comments ·
-
bug package:stack
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
react-navigation/react-navigation#8546 · 7 comments · 8 reactions ·
-
package:bottom-tabs platform:ios repro provided
Difficulty 3/5 1-2 days Newbie friendliness 68/100
react-navigation/react-navigation#13262 · 1 comment ·
All issues in react-navigation/react-navigation
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ontola/atomic-server#1625 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
melgarafael/DeskcommCRM#1451 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
midnightntwrk/midnight-sdk#403 ·