Closed siamahnaf closed 1 year ago
@siamahnaf with this you can use setContents
instead of defaultValue
.
<SunEditor
placeholder="Please type here..."
setOptions={{
buttonList: [["undo", "redo"], ["font", "fontSize", "formatBlock"], ["paragraphStyle", "blockquote"], ["bold", "underline", "italic", "strike", "subscript", "superscript"], ["fontColor", "hiliteColor", "textStyle"], ["removeFormat"], ["outdent", "indent"], ["align", "horizontalRule", "list", "lineHeight"], ["table", "link", "codeView", "showBlocks"], ["preview", "fullScreen"]]
}}
setDefaultStyle="font-family: Arial; font-size: 16px;"
height="180px"
onChange={onChange}
name="description"
setContents={value}
/>
After you want to clear
// lets say value can be changed from state
setValue('')
Hello, I am not finding any options in docs to reset editor. I need to reset whole editor when form is submited. Can you give me direction about this.