Я новичок в React Native, это мой первый проект в нем, моя проблема в том, что когда я попытался запустить другой экран в React Native, я получил эту ошибку: undefined не является объектом (оценка «this.props.navigator.push»), я не знаю знаю почему, потому что у меня нет опыта работы с react native
это мой код, если у кого есть идеи!
class loginApp extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.title}>
Welcome Sign Up Here
</Text>
<View>
<TextInput
placeholder="Name"
style={styles.formInput}
/>
<TextInput
placeholder="Password"
secureTextEntry={true}
style={styles.formInput}
/>
<TextInput
placeholder="UserName"
style={styles.formInput}
/>
<TextInput
placeholder="Email"
style={styles.formInput}
/>
<TouchableHighlight onPress={this.onPress.bind(this)} style={styles.button}>
<Text style={styles.buttonText}>Submit</Text>
</TouchableHighlight>
</View>
</View>
);
}
onPress() {
this.props.navigator.push({
title: "Secure Page",
component: SecureView,
});
};
};