javascript - 文本框不输入文本
问题描述
我是 ReactNative 的新手,我正在尝试在我的 TextBoxes 上书写。虽然,我不能输入任何东西。这是我在 Signup.js 上的文本输入段
renderTextInput = (field) => {
const {meta: {touched, error}, label, secureTextEntry, maxLength, keyboardType, placeholder, input: {onChange, ...restInput}} = field;
return(
<View>
<InputText
onChangeText={onChange}
maxLength={maxLength}
placeholder={placeholder}
keyboardType={keyboardType}
secureTextEntry={secureTextEntry}
label={label}
{...restInput} />
{touched && <Text style={styles.errorText}>{error}</Text>}
</View>
);
}
render() {
const {handleSubmit} = this.props;
return(
<View style={styles.container}>
<Logo/>
<Field
name="name"
placeholder="Insira o seu nome"
component={this.renderTextInput} />
<Field
name="email"
placeholder="Insira o seu email"
component={this.renderTextInput} />
<Field
name="password"
placeholder="Password"
secureTextEntry={true}
component={this.renderTextInput} />
<TouchableOpacity style={styles.button} onPress={handleSubmit(this.onSubmit)}>
<Text style={styles.buttonText}>Signup</Text>
</TouchableOpacity>
<View style={styles.signupTextCont}>
<Text style={styles.signupText}>Ja tens uma conta?</Text>
<TouchableOpacity onPress={this.goBack}><Text style={styles.signupButton}> Entra</Text></TouchableOpacity>
</View>
</View>
)
}
}
我不明白为什么会这样。请帮我
解决方案
推荐阅读
- reactjs - 为什么 tesseract 不能在带有反应的浏览器中工作?
- asp.net-mvc - 方法被调用两次
- python - 如何将张量更改为 NumPy?
- c# - C#正则表达式提取多个结构键值
- php - 有没有更好的方法来检查一个集合是否包含一个字段然后是多个 isset?
- reactjs - 由于服务器和客户端中的 className 不同,Material UI 中定义的 withStyle 出现问题
- reactjs - 不明白为什么重复数据被复制到我的反应组件中的 url
- python-3.x - gobject-2.0-0 无法在 macbook 上加载
- javascript - 如何防止执行某行 Javascript 代码?
- google-apps-script - 尝试复制时出现“无效的参数数量”错误