Last active
February 15, 2022 09:06
-
-
Save hubgit/d3f3e402379e538ed13a53bd3b9562a4 to your computer and use it in GitHub Desktop.
Dynamic import of modules for react-wysiwyg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Promise.all([ | |
import('draft-js'), | |
import('draftjs-to-html'), | |
import('html-to-draftjs'), | |
import('react-draft-wysiwyg'), | |
import('react-draft-wysiwyg/dist/react-draft-wysiwyg.css') | |
]).then(([ | |
{ ContentState, EditorState, convertToRaw }, | |
{ default: draftToHtml }, | |
{ default: htmlToDraft }, | |
{ Editor } | |
]) => { | |
this.deps = { ContentState, EditorState, convertToRaw, draftToHtml, htmlToDraft, Editor } | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment