I am not able to load default value style in React-draft-wysiwyg . Codesandbox Link: Editor
what I tried ? I am using react-draft-wysiwyg library for editor and draft-js for initializing and converting , and I have passed default value with style. if i remove style tag it works fine. but after adding style it doesn't work. how to fix style issue in default value
import { Editor } from "react-draft-wysiwyg";
import { EditorState, ContentState, convertFromHTML } from "draft-js";
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
export default function App() {
const defaultValueRender = !true;
const defaultValue = "**<p style="color:red**">This is a paragraph.</p>";
const initialState = () => EditorState.createEmpty();
const [editorState, setEditorState] = useState(initialState);
useEffect(() => {
if (defaultValue !== "") {
setEditorState(
EditorState.createWithContent(
ContentState.createFromBlockArray(convertFromHTML(defaultValue))
)
);
}
}, []);
const onChange = async (value) => {
await setEditorState(value);
};
return (
<div className="App">
<Editor
editorState={editorState}
toolbarClassName="toolbarClassName"
wrapperClassName="wrapperClassName"
editorClassName="editorClassName"
onEditorStateChange={(value) => onChange(value)}
stripPastedStyles
ariaLabel="draftEditor"
/>
</div>
);
}