You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versioned_docs/version-6.x/navigation-container.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,12 @@ All of these methods will act as if they were called inside the currently focuse
72
72
73
73
In addition to these methods, the ref object also includes the following special methods:
74
74
75
+
#### `isReady`
76
+
77
+
The `isReady` method returns a `boolean` indicating whether the navigation tree is ready. The navigation tree is ready when the `NavigationContainer` contains at least one navigator and all of the navigators have finished mounting.
78
+
79
+
This can be used to determine whether it's safe to dispatch navigation actions without getting an error. See [handling initialization](navigating-without-navigation-prop.md#handling-initialization) for more details.
80
+
75
81
#### `resetRoot`
76
82
77
83
The `resetRoot` method lets you reset the state of the navigation tree to the specified state object:
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/navigation-container.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,12 @@ All of these methods will act as if they were called inside the currently focuse
73
73
74
74
In addition to these methods, the ref object also includes the following special methods:
75
75
76
+
#### `isReady`
77
+
78
+
The `isReady` method returns a `boolean` indicating whether the navigation tree is ready. The navigation tree is ready when the `NavigationContainer` contains at least one navigator and all of the navigators have finished mounting.
79
+
80
+
This can be used to determine whether it's safe to dispatch navigation actions without getting an error. See [handling initialization](navigating-without-navigation-prop.md#handling-initialization) for more details.
81
+
76
82
#### `resetRoot`
77
83
78
84
The `resetRoot` method lets you reset the state of the navigation tree to the specified state object:
@@ -214,6 +220,10 @@ Example:
214
220
</NavigationContainer>
215
221
```
216
222
223
+
This callback won't fire if there are no navigators rendered inside the container.
224
+
225
+
The current status can be obtained with the [`isReady`](#isready) method on the ref.
226
+
217
227
### `onUnhandledAction`
218
228
219
229
Function which is called when a navigation action is not handled by any of the navigators.
0 commit comments