Listens changes to the navigation stack
the "change"
event name
the StackOnChange callback function
Listens for screen replacements
the "push"
event name
the StackOnPush callback function
The callback will be invoked when screens are popped off the stack
the "pop"
event name
the StackOnPop callback function
Listens for navigation resets
the "reset"
event name
the StackOnReset callback function
Listens for screen replacements
the "replace"
event name
the StackOnReplace callback function
Removes the event listener from the emitter
the "change"
event name
the StackOnChange callback function that was added through addListener
Removes the event listener from the emitter
the "change"
event name
the StackOnPush callback function
Removes the event listener from the emitter
the "change"
event name
the StackOnPop callback function
Removes the event listener from the emitter
the "change"
event name
the StackOnReset callback function
Removes the event listener from the emitter
the "change"
event name
the StackOnReplace callback function
The event emitter for stack changes. Can be used to understand the state of the navigation
const callback: StackOnChange = ({ screen }) => console.log(getScreenName(screen));
// Add listener, usually done in the application container
componentDidMount
stackEventEmitter.addListener(StackEvent.Change, callback);// Remove the listener, usually done in the application container
componentWillUnmount
stackEventEmitter.removeListener(StackEvent.Change, callback);`