Skip to content

Commit

Permalink
Merge pull request #35668 from software-mansion-labs/ideal-nav/link-t…
Browse files Browse the repository at this point in the history
…o-type-error

Fix type error in linkTo
  • Loading branch information
Hayata Suenaga authored Feb 4, 2024
2 parents 3ab4e6e + 1a4717a commit 49eb35b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/libs/Navigation/linkTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,18 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam
// stateFromPath should always include bottom tab navigator state, so getMatchingCentralPaneRouteForState will be always defined.
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const matchingCentralPaneRoute = getMatchingCentralPaneRouteForState(stateFromPath)!;
root.dispatch({
type: CONST.NAVIGATION.ACTION_TYPE.PUSH,
payload: {
name: NAVIGATORS.CENTRAL_PANE_NAVIGATOR,
params: {
screen: matchingCentralPaneRoute.name,
params: matchingCentralPaneRoute.params,
if (matchingCentralPaneRoute && 'name' in matchingCentralPaneRoute) {
root.dispatch({
type: CONST.NAVIGATION.ACTION_TYPE.PUSH,
payload: {
name: NAVIGATORS.CENTRAL_PANE_NAVIGATOR,
params: {
screen: matchingCentralPaneRoute.name,
params: matchingCentralPaneRoute.params,
},
},
},
});
});
}
} else {
// If the layout is small we need to pop everything from the central pane so the bottom tab navigator is visible.
root.dispatch({
Expand Down

0 comments on commit 49eb35b

Please sign in to comment.