0
我使用的反应介质编辑器(https://github.com/wangzuo/react-medium-editor)和文本编辑器中永不熄灭空白阵营 - 中 - 编辑文本不工作
handleChange=(text)=>{
this.setState({text: text});
}
Submit(){
this.setState({text: ''});
}
render(){
return(
<div>
<Editor
text={this.state.text}
onChange={this.handleChange}
options={{placeholder: {text: "Write your response here"},
toolbar: {buttons: ['bold', 'italic', 'underline'],
}}} />
<button onClick={this.Submit.bind(this)}></button>
</div>
)
}
当我点击按钮this.setState是建立文本的价值为空,但编辑文本永远不会变为空白。
如何通过设置状态使编辑器值为空。
是的这是回购链接https://github.com/komaldeep/Medium-Editor –
帮助我..如果你可以 –