Skip to content

Instantly share code, notes, and snippets.

@ijonas
Created April 1, 2015 09:05
Show Gist options
  • Save ijonas/41e3a155e94c64fc4630 to your computer and use it in GitHub Desktop.
Save ijonas/41e3a155e94c64fc4630 to your computer and use it in GitHub Desktop.
ReactNative NavigatorIOS component doesn't pass 'navigator' object into props
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,
}}
/>
)
}
})
@ijonas
Copy link
Author

ijonas commented Apr 1, 2015

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment