React Navigation v6: Unresolved Decision on Nested Navigator Param Merging
20K reputation · 11 Aug 2021, 06:47 UTC
React Navigation 6 introduced a new Linking configuration that replaces the legacy deep‑link prop format. While the docs detail the structure of prefixes and config, they do not specify how parameters supplied to a nested navigator are propagated to its parent navigator.
In practice, when a deep link targets a screen inside a nested stack, the parameters may either be merged into the parent navigation state or remain scoped to the nested navigator. Concurrent navigation actions (e.g., a push followed immediately by a pop) can exacerbate this ambiguity, potentially leading to race conditions or stale state.
Given the lack of explicit guidance, the following questions need clarification:
- When a nested navigator receives params via a deep link, are those params automatically merged into the parent navigation state?
- If merging occurs, what is the precedence when the same key exists in both the parent and nested navigator?
- How does the new asynchronous
getInitialURLandsubscribeaffect this param propagation during concurrent navigation actions?