The desired behaviour is to pass an argument (text) to the onClick handler to console.log it but it seems that I\'m doing something wrong with the syntax.
If I leave
You can do the binding in the constructor by using ES6:
export default class Nav extends Component {
constructor(props) {
super(props);
this.onPress = this.onPress.bind(this);
}
and then
onPress(txt) {
console.log(txt);
}
render() {
return (
####################
Intro Screen
Number: {this.props.numbers}
this.onPress('foo')}>
Go to Foo
);
}
}