react draft wysiwyg typescript

Solutions on MaxInterview for react draft wysiwyg typescript by the best coders in the world

showing results for - "react draft wysiwyg typescript"
Amanda
07 Oct 2017
1import Draft, { htmlToDraft, draftToHtml, EmptyState, rawToDraft, draftToRaw , draftStateToHTML} from 'react-wysiwyg-typescript' state = {    editorState: htmlToDraft('Your html contents'// or use an EmptyState} <Draft    editorState={this.state.editorState}    onEditorStateChange={(editorState) => { this.setState({ editorState }) }}/> // save html to server const html = draftToHtml(content) // convert raw to draft const toDraft = rawToDraft(content) // convert draft to raw const toRaw = draftToRaw(content) // convert rawToDraft file to HTML const toHTML = draftStateToHTML(content)