我正在使用React.js和React InlineEdit。我想编辑文本,并保存文本 这个新的价值是我的代码:反应:编辑后保存值
//{etape.title} is not empty
<InlineEdit
validate={this.customValidateText}
activeClassName="editing"
text={etape.title}
paramName="message"
change={this.dataChanged}
/>
dataChanged(text) {
this.setState({
editStep: text.target.value
})
}
customValidateText(text) {
return (text.length > 0 && text.length < 64);
}
所以我可以编辑我的文字,但是当我在文本中单击,值BU默认回来,不是编辑的值。
我该怎么做? 谢谢
你试试这个:'变化= {(文本)=> this.dataChanged(文字)}' –
是,但我有同样的问题:( –