File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ Each `screen` component in your app is provided with the `navigation` prop autom
99* ` this.props.navigation `
1010 * ` navigate ` - go to another screen, figures out the action it needs to take to do it
1111 * ` goBack ` - close active screen and move back in the stack
12+ * ` addListener ` - subscribe to updates to navigation lifecycle
1213 * ` state ` - current state/routes
1314 * ` setParams ` - make changes to route's params
1415 * ` dispatch ` - send an action to router
@@ -98,6 +99,15 @@ Then you need to supply a key to goBack _FROM_:
9899navigation.goBack(SCREEN_KEY_B) // will go to screen A FROM screen B
99100```
100101
102+ ### ` addListener ` - Subscribe to updates to navigation lifecycle
103+
104+ React Navigation emits events to screen components that subscribe to them:
105+
106+ - ` willBlur ` - the screen will be unfocused
107+ - ` willFocus ` - the screen will focus
108+ - ` didFocus ` - the screen focused (if there was a transition, the transition completed)
109+ - ` didBlur ` - the screen unfocused (if there was a transition, the transition completed)
110+
101111### ` state ` - The screen's current state/route
102112
103113A screen has access to its route via ` this.props.navigation.state ` . Each will return an object with the following:
You can’t perform that action at this time.
0 commit comments