I have 2 TextInput and i want to store the value in my state :
<CustomInput
underlineColorAndroid="#58CAF1"
style={styles.inputScheduleTime}
// ref="lundiStart"
placeholder="18H00..."
keyboardType="numeric"
onChangeText={ input2 => {
this.setState({ monday: {
start: this.state.monday.start,
end:this.state.monday.end + ':' + input2 }
});
console.log(this.state.monday)
}
}
/>
When i store the value of my input, he store the value but add a 0 between..... :
this is a screenshot of my input:
I start by typing 9 then 00 then 10 and finally 00
i had console log like that, input4 being the fourth and last input :
<CustomInput
underlineColorAndroid="#58CAF1"
style={styles.inputScheduleTime}
// ref="lundiStart"
placeholder="18H00..."
keyboardType="numeric"
onChangeText={ input4 => {
console.log("input4 : " + input4);
this.setState({ monday: {
start: this.state.monday.start,
end:this.state.monday.end + ':' + input4 }
});
console.log("start : " + this.state.monday.start);
console.log("end : " + this.state.monday.end);
}
}
/>
and the log of my console :
I don't understand why ?? maybe my way of set the state?