File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -10,16 +10,17 @@ A navigator is any React component that has a [router](https://github.com/react-
1010class MyNavigator extends React .Component {
1111 static router = MyRouter;
1212 render () {
13- const { state , dispatch } = this .props .navigation ;
13+ const { state , dispatch , addListener } = this .props .navigation ;
1414 const { routes , index } = state;
1515
1616 // Figure out what to render based on the navigation state and the router:
1717 const Component = MyRouter .getComponentForState (state);
1818
1919 // The state of the active child screen can be found at routes[index]
20- let childNavigation = { dispatch, state: routes[index] };
20+ let childNavigation = { dispatch, addListener, state: routes[index] };
2121 // If we want, we can also tinker with the dispatch function here, to limit
2222 // or augment our children's actions
23+ // addListener is needed to support children Stack and Drawer navigators
2324
2425 // Assuming our children want the convenience of calling .navigate() and so on,
2526 // we should call addNavigationHelpers to augment our navigation prop:
You can’t perform that action at this time.
0 commit comments