Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow deep linking to reset state
Currently when we receive a deep link after the app is rendered, it always results in a `navigate` action. While it's ok with the default configuration, it may result in incorrect behaviour when a custom `getStateForPath` function is provided and it returns a routes array different than the initial route and new route pair. The commit changes 2 things: 1. Add ability to reset state via params of `navigate` by specifying a `state` property instead of `screen` 2. Update `getStateForAction` to return an action for reset when necessary according to the deep linking configuration
- Loading branch information
Showing
9 changed files
with
737 additions
and
88 deletions.
There are no files selected for viewing
406 changes: 389 additions & 17 deletions
406
packages/core/src/__tests__/getActionFromState.test.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.