I am using draftjs for editor. I could parse html code that comes from api to markup. But how can i display a html button so that when clicked on it, it should allow to write html code.
How can i do it so?
Here is my code. I am using react-draft-wysiwyg
<div>
<Editor
tabIndex={0}
hashtag={{}}
editorState={editorState}
initialContentState={this.props.htmlMarkup}
toolbarClassName="home-toolbar"
wrapperClassName="home-wrapper"
editorClassName="home-editor"
onEditorStateChange={this.onEditorStateChange}
decorators={decorator}
// toolbarOnFocus
toolbar={{
history: { inDropdown: true },
inline: { inDropdown: false },
list: { inDropdown: true },
link: { showOpenOptionOnHover: true },
textAlign: { inDropdown: true },
image: {
uploadCallback: this.imageUploadCallBack,
defaultSize: { height: "auto", width: "50%" }
}
}}
onContentStateChange={this.onEditorChange}
placeholder="write text here..."
spellCheck
onChange={this.handleChange}
onBlur={this.handleBlur}
/>
</div>