1
私はフォームを提出しようとしていますが、値を取得することはできません。onPressフォームの提出と値の処理
<Field
name="email"
component={this.renderInput}
type="email"
validate={[email, required]}
/>
<Field
name="password"
component={this.renderInput}
type="password"
validate={[alphaNumeric, minLength8, maxLength15, required]}
/>
<Button
rounded
primary
block
large
style={styles.loginBtn}
onPress={() => this.login()}
>
、ここでログイン機能は次のようになります。:
login() {
if (this.props.valid) {
//do something here, but how to get the data?
} else {
Toast.show({
text: "Enter Valid Username & password!",
duration: 2500,
position: "top",
textStyle: { textAlign: "center" }
});
}
}
私はボタンをクリックしてlogin()
機能を取得、さらには渡すことができます。ここ
は私のフォームは次のようになります。 if(this.props.valid
)のチェックをしましたが、ログイン機能で電子メールとパスワードの値を取得する方法がわかりません。