Skip to content

Commit 0d93eab

Browse files
committed
Document ready event on the ref
1 parent 7e1370b commit 0d93eab

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

versioned_docs/version-7.x/navigation-container.md

+13
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,19 @@ Note that the returned `options` object will be `undefined` if there are no navi
237237

238238
The `addListener` method lets you listen to the following events:
239239

240+
##### `ready`
241+
242+
The event is triggered when the navigation tree is ready. This is useful for cases where you want to wait until the navigation tree is mounted:
243+
244+
```js
245+
const unsubscribe = navigationRef.addListener('ready', () => {
246+
// Get the initial state of the navigation tree
247+
console.log(navigationRef.getRootState());
248+
});
249+
```
250+
251+
This is analogous to the [`onReady`](#onready) method.
252+
240253
##### `state`
241254

242255
The event is triggered whenever the [navigation state](navigation-state.md) changes in any navigator in the navigation tree:

0 commit comments

Comments
 (0)