I'd like to know why this code doesn't work :
<TextInput
style={style.inputLogin}
onChangeText={this.handleInputChange}
value={this.state.login}
/>
with the function :
handleInputChange = (event) => {
console.log(event.target.name);
this.setState({
[name]: value
});
console.log("name => ", [name]);
console.log("value => ", value);
}
I tried many things but i can't get the targeted form. Should I make one function for each input ? seems to be stupid :/ event only contains the value of the form. Sure I could do this :
<TextInput
style={style.inputLogin}
onChangeText={(value) => this.setState({value}))
value={this.state.login}
/>
But this is not what I am looking for. I would like something more generic that works for every input
Please help me ;)