Created
April 1, 2015 09:05
-
-
Save ijonas/41e3a155e94c64fc4630 to your computer and use it in GitHub Desktop.
ReactNative NavigatorIOS component doesn't pass 'navigator' object into props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var CBSupport = React.createClass({ | |
_handleNextButtonPress: function() { | |
debugger | |
AlertIOS.alert("Be A Lert"); | |
// this.props does not contain a 'navigator' property | |
this.props.navigator.push({ | |
component: Login, | |
title: 'Login' | |
}); | |
}, | |
render: function() { | |
return( | |
<NavigatorIOS | |
style={styles.container} | |
initialRoute={{ | |
component: Accounts, | |
title: 'Accounts', | |
rightButtonTitle: 'Add', | |
onRightButtonPress: this._handleNextButtonPress, | |
}} | |
/> | |
) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm probably doing something wrong, but I'm trying to navigate to a new scene by tapping the right button on a NavigatorIOS component.
The onRightButtonPress fires, as does the subsequent AlertIOS, but this.props doesn't contain a reference to the navigator.
What am I missing?