NavigationEvents is a React component providing a declarative API to subscribe to navigation events. It will subscribe to navigation events on mount, and unsubscribe on unmount.
navigation- navigation props (optional, defaults to reading from React context)
onWillFocus- event listener
onDidFocus- event listener
onWillBlur- event listener
onDidBlur- event listener
The event listener is the same as the imperative