Last active
March 14, 2019 08:06
-
-
Save luandevpro/36df032824ed4512d2d8c2ccfd037085 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
import { stateToHTML } from "draft-js-export-html"; | |
import Parser from "html-react-parser"; | |
... | |
render() { | |
var { editorState } = this.state; | |
return ( | |
<div> | |
<Formik | |
initialValues={{ editorState }} | |
onSubmit={this.handleSubmit} | |
> | |
{props => <FormField {...props} />} | |
</Formik> | |
<div style={{ textAlign: "justify" }}> | |
{Parser(stateToHTML(this.state.editorState.getCurrentContent()))} | |
</div> | |
</div> | |
); | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment