Hi in my componentWillMount I set my states like this
componentWillMount(){
this.timeSheetData().then((timeSheetResponse)=>{
this.setState({comments:timeSheetResponse.comments});
this.setState({spentHours:parseInt(timeSheetResponse.hours)});
alert(this.state.spentHours);
});
});
In my view
I have the TextInput like this. I can't display the value on the TextInput but I can display the value on Text I don't know why it's happening
<TextInput keyboardType='numeric' onChangeText={(spentHours) =>this.setState({spentHours})}
value={this.state.spentHours} />