Search code examples
reactjsredux-formdraftjs

Combine draft-js with redux-form


I have a form with 2 usual inputs where i can use this common approach:

<input {...title} />

And also i have a draftJS editor in the form. I need to convert draftJS content to HTML (via draft-js-export-html) on submit, and load html to it on component mount process. How to combine it with redux-form?


Solution

  • I solved it. Using draft-js-export-html I keep html version of DraftJS editor content in the local storage. Parent container has a passed to child function calling this.props.fields.MYFIELD.onChange(CHILDLOCALSTATE).