Skip to content

Commit

Permalink
Document isReady method
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Dec 1, 2023
1 parent f111a4c commit 2129b35
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions versioned_docs/version-6.x/navigation-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ All of these methods will act as if they were called inside the currently focuse

In addition to these methods, the ref object also includes the following special methods:

#### `isReady`

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.

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.

#### `resetRoot`

The `resetRoot` method lets you reset the state of the navigation tree to the specified state object:
Expand Down
10 changes: 10 additions & 0 deletions versioned_docs/version-7.x/navigation-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ All of these methods will act as if they were called inside the currently focuse

In addition to these methods, the ref object also includes the following special methods:

#### `isReady`

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.

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.

#### `resetRoot`

The `resetRoot` method lets you reset the state of the navigation tree to the specified state object:
Expand Down Expand Up @@ -214,6 +220,10 @@ Example:
</NavigationContainer>
```

This callback won't fire if there are no navigators rendered inside the container.

The current status can be obtained with the [`isReady`](#isready) method on the ref.

### `onUnhandledAction`

Function which is called when a navigation action is not handled by any of the navigators.
Expand Down

0 comments on commit 2129b35

Please sign in to comment.