-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Key docs #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Key docs #115
Conversation
docs/navigation-key.md
Outdated
### Idempotent navigation with the [`navigate` call](/docs/navigation-actions.html#navigate) | ||
|
||
`navigate` function accepts an optional `key` parameter which is used as an identifier for the route to navigate to. If you provide the identifier (as for example in `navigate({ routeName: 'someScreen', params: { someParam: 'someValue' }, key: 'someScreen' })`) and user triggers such navigation action multiple times (eg. by pushing a button that calls the navigation action quickly multiple times in a row), the navigation action will be executed only once. | ||
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
docs/navigation-key.md
Outdated
|
||
### Usage with [`reset`](/docs/navigation-actions.html#reset) | ||
|
||
When resetting, `key` is also optional and can be a string or null. If set, the navigator with the given key will reset. If null, the root navigator will reset. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
docs/navigation-key.md
Outdated
|
||
### Usage with [`replace`](/docs/navigation-actions.html#replace) | ||
|
||
With replace, key is a required parameter used for identifying the route to be replaced. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
docs/navigation-key.md
Outdated
|
||
### Usage with `goBack` | ||
|
||
Please refer to the [`goBack docs`](/docs/navigation-prop.html#goback-close-the-active-screen-and-move-back) for a detailed explanation. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
docs/navigation-key.md
Outdated
|
||
### Usage with the [`navigate`](/docs/navigation-actions.html#navigate) call | ||
|
||
TL;DR: The behavior of `navigate` together with `key` depends on the version of react-navigation you use. In v1, key has to be provided for navigate to behave idempotently. In v2, this is no longer needed. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
f56dd53
to
c010f5a
Compare
thank you! this will be very helpful for people |
closes #50