iam new in react native這是我的第一個項目,我的問題是當我試圖啓動另一個屏幕成反應本機我得到這個錯誤 :undefined不是一個對象(評估'this.props.navigator.push') 我不知道爲什麼因爲我沒有任何經驗與反應原生
這是我的代碼,如果有人有主意!React Native,Android,undefined不是對象(評估'this.props.navigator.push')與TouchableHighlight
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,
});
};
};
這是http://stackoverflow.com/questions/39928565/this2-props-navigator-push-is-not-a的更多鈔票副本功能/ 39958933?noredirect = 1#comment67436731_39958933 –
不,請另一種情況! –