我正在调用此函数:
dataChanged(data) {
// data = { description: "New validated text comes here" }
// Update your model from here
console.log(data)
this.setState({data}, function(){
console.log(this.state)
})
}
但我仍然有相同的状态......
我称之为元素:
<CollapsibleItem header="My Goal" icon='public'>
<InlineEdit
validate={this.customValidateText}
activeClassName="editing"
text={this.state.goal}
paramName="goal"
change={this.componentDidUpdate}
/>
</CollapsibleItem>
我也尝试过调用此函数:
componentDidUpdate(prevProps, prevState) {
if (this.state.goal !== prevState.goal) {
console.log(this.state)
}
}
也没用?