Javascript 文本框不输入文本
我是ReactNative新手,我正在尝试在我的文本框上写字。虽然,我不能输入任何东西。这是我在Signup.js上输入文本的部分Javascript 文本框不输入文本,javascript,reactjs,react-native,react-native-android,react-native-textinput,Javascript,Reactjs,React Native,React Native Android,React Native Textinput,我是ReactNative新手,我正在尝试在我的文本框上写字。虽然,我不能输入任何东西。这是我在Signup.js上输入文本的部分 renderTextInput = (field) => { const {meta: {touched, error}, label, secureTextEntry, maxLength, keyboardType, placeholder, input: {onChange, ...restInput}} = field; return( <
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>
)
}
}
renderTextInput=(字段)=>{
const{meta:{toucted,error},label,secureTextEntry,maxLength,keyboardType,占位符,输入:{onChange,…restInput}}=field;
返回(
{触摸&&{error}
);
}
render(){
const{handleSubmit}=this.props;
返回(
报名
你有空吗?
恩特拉
)
}
}
我不明白为什么会这样。
请帮助我更改后的
是什么?如何更新它的值?在这里执行:onChangeText={onChange}。。。什么是onChange?还有另一个问题,我还不太熟悉本地人的反应,所以别误会,我在youtube视频上看到了以下链接:我如何更新它的价值?