diff --git a/packages/react-navigation/src/views/withNavigation.js b/packages/react-navigation/src/views/withNavigation.js index c2fe0085..318ff478 100644 --- a/packages/react-navigation/src/views/withNavigation.js +++ b/packages/react-navigation/src/views/withNavigation.js @@ -10,12 +10,14 @@ export default function withNavigation(Component) { Component.name})`; render() { + const navigationProp = this.props.navigation; return ( - {navigation => { + {navigationContext => { + const navigation = navigationProp || navigationContext; invariant( !!navigation, - 'withNavigationFocus can only be used on a view hierarchy of a navigator. The wrapped component is unable to get access to navigation from props or context.' + 'withNavigation can only be used on a view hierarchy of a navigator. The wrapped component is unable to get access to navigation from props or context.' ); return (