import React, {useState} from "react"; import {Editor} from "react-draft-wysiwyg"; import Draft from "draft-js"; import {Stack, Text} from "@chakra-ui/react"; import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; export default function TextBox(props: any) { const {value, OnChange} = props; var EditorState = Draft.EditorState; var ContentState = Draft.ContentState; const [editorState, setEditorState] = useState(() => EditorState.createWithContent(ContentState.createFromText(value)) ); function onFieldChange(editorState: any) { setEditorState(editorState); props.OnChange(editorState.getCurrentContent().getPlainText()); } return ( Content
); }