为了使输入值可编辑,您需要具有onChange
用于更新输入值的处理程序。并且由于要调用onBlur函数,因此必须像onBlur={() => this.props.actions.updateinput()}
componentDidMount() {
this.setState({inputValue: this.props.inputValue});
}
handleChange = (e) => {
this.setState({inputValue: e.target.value});
}
<input value={this.state.inputValue} onChange={this.handlechange} onBlur={() => this.props.actions.updateInput(this.state.inputValue)} />