我正在使用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(文字)}' –
是,但我有同樣的問題:( –