Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript React Draft.js中的图像显示问题_Javascript_Reactjs_Draftjs_React Draft Wysiwyg - Fatal编程技术网

Javascript React Draft.js中的图像显示问题

Javascript React Draft.js中的图像显示问题,javascript,reactjs,draftjs,react-draft-wysiwyg,Javascript,Reactjs,Draftjs,React Draft Wysiwyg,我正在我的一个项目中使用react draftjs。然而,当我尝试通过url添加图像时,图像会显示出来,但当我保存它并将信息发送到服务器,然后再获取它时,我并没有得到任何图像。它只是一个空的数字标签 我国: const [editorState, setEditorState] = useState(() => EditorState.createEmpty() ); const [convertedContent, setConvertedContent] = useState

我正在我的一个项目中使用react draftjs。然而,当我尝试通过url添加图像时,图像会显示出来,但当我保存它并将信息发送到服务器,然后再获取它时,我并没有得到任何图像。它只是一个空的数字标签

我国:

const [editorState, setEditorState] = useState(() =>
    EditorState.createEmpty()
);

const [convertedContent, setConvertedContent] = useState(null);

const handleEditorChange = (state) => {
    setEditorState(state);
    convertContentToHTML();
};

const convertContentToHTML = () => {
    let currentContentAsHTML = convertToHTML(editorState.getCurrentContent());
    setConvertedContent(currentContentAsHTML);
};
我的编辑公司:

<Editor
     editorState={editorState}
     onEditorStateChange={handleEditorChange}
     wrapperClassName="wrapper-class"
     editorClassName="editor-class"
   toolbarClassName="toolbar-class"
    placeholder="Type something here..."
    toolbar={{
    inline: { inDropdown: false },
    list: { inDropdown: true },
    textAlign: { inDropdown: false },
    link: { inDropdown: true },
    history: { inDropdown: false },
   }}
  />