html-to-draftjs
html-to-draftjs copied to clipboard
SSR htmlToDraft return null
On server side htmlToDraft returns null
Hello @rgnevashev , try to use JSDOM on server side for this.
I'm having the same issue, would be great to have an example server side usage case in the docs / npm / github page.
Using HTML as format to save editor content is anyways avoidable. Prefer to save it as RawDraftJS content JSON format.
Did just that, working good for me now, excellent module, thank you.
@jpuri This issue sounds like the problem I'm having but in my case htmlToDraft() returns null only in the Firefox browser. I've tested in Chrome/Chromium and htmlToDraft() returns non-null. Could you at least confirm that this is indeed an issue in Firefox? And it sounds like you're suggesting that we store the entire DraftJS JSON instead of just the HTML string?
const contentBlock = htmlToDraft(HTMLString); // Returns null in Firefox.