How to integrate react-draft-wysiwyg with react-hook-form #1764
-
Hi guys, I need some help. I was using react-final-form in my project but I've decided to change for react-hook-form. By the way, I love it, but I got stuck. :/ On my page, I'm using an editor to collect some info from a user. At the moment I'm using react-draft-wysiwyg. parentComponent.js
WYSIWYGEditor.js
PLEASE NOTE:
and I get the following in the console.log when I type anything:
As you can see, value is Thanks for your help |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 21 replies
-
provide a simple codesandbox. |
Beta Was this translation helpful? Give feedback.
-
Also, i tried with the code below: import React, { useState } from "react"; // Components import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; const Summerform = props => { const [editorState, setEditorState] = useState(EditorState.createEmpty()); return ( </React.Fragment> ); }; export default Summerform; But here on running the code above it is giving undefined. props editor EditorState {_immutable: Record}_immutable: Record {_map: Map, __ownerID: undefined}[[Prototype]]: Object Please please help. |
Beta Was this translation helpful? Give feedback.
-
Hi Matt, Bill Please help. earnest request. |
Beta Was this translation helpful? Give feedback.
-
hi mattbaratella & bluebill1049, Please help earnest request. I am literally stuck with integrating react-draft-wysiwyg with react-hook-form and not getting any way outs. |
Beta Was this translation helpful? Give feedback.
-
@mattbaratella You can use the library https://www.npmjs.com/package/@tonz/react-draft-wysiwyg-input
|
Beta Was this translation helpful? Give feedback.
provide a simple codesandbox.