Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const ConvertFromHTMLDemo = () => {
const [html, setHTML] = useState();
const [updateEditor, setUpdateEditor] = useState();
const defaultValue = NibConverter.convertFromHTML(html);
useEffect(() => {
if (updateEditor) setUpdateEditor(false);
}, [updateEditor]);
return (
<div>
<textarea value="{html}" placeholder="Enter HTML"> setHTML(evt.target.value)}
/>
<button
className="docs_btn nib-html_btn"
type="button"
onClick={() => setUpdateEditor(true)}
></textarea></div>
const ConvertToHTMLDemo = () => {
const [content, setContent] = useState();
const htmlStr = NibConverter.convertToHTML((content || defaultValue).doc);
return (
<div>
</div>