You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Luis and first of all thank you for making and maintaining this library.
I've encountered the following situation where I need to use exporter without having access to an EditorState object, but a ContentState object. The reason behind this is that I need to render HTML in another part of our application where a DraftJS editor is not instantiated.
That being said, the only data I can get is a ContentState object returned by the convertFromRaw function. The problem arises when exporter tries to access the getCurrentContent() method from the editorState object passed as argument.
I think this is somewhat related to this issue, in my case converting from raw content rather than HTML.
I managed to make a fork and fix this and I'm more than happy to make a pull request, but I wanted to discuss this first.
Is there a reason for requiring EditorState in in the export process or is this just an edge case?
Am I missing something and is there the possibility of converting from raw directly to EditorState?
Thanks :)
The text was updated successfully, but these errors were encountered:
Change the library.
Accept ContentState|EditorState as inputs and create the logic for handling both.
Change the API to accept only the ContentState.
The easiest one will probably be option 1 because you can probably already use the library as is, but option 2 seems like it would be more flexible. I am somewhat hesitant about options 3 because It would be a breaking change.
I would accept a PR that handles option 2 as long as it has tests for accepting an EditorState or a ContentState. as inputs.
Initially I created the API to take in an EditorState, and I overlooked your specific case. I think it is a valid request. Feel free to submit a PR and I will take a look at it whenever I can. Thank you!
Hi Luis and first of all thank you for making and maintaining this library.
I've encountered the following situation where I need to use
exporter
without having access to anEditorState
object, but aContentState
object. The reason behind this is that I need to render HTML in another part of our application where a DraftJS editor is not instantiated.That being said, the only data I can get is a
ContentState
object returned by theconvertFromRaw
function. The problem arises whenexporter
tries to access thegetCurrentContent()
method from theeditorState
object passed as argument.I think this is somewhat related to this issue, in my case converting from raw content rather than HTML.
I managed to make a fork and fix this and I'm more than happy to make a pull request, but I wanted to discuss this first.
Is there a reason for requiring
EditorState
in in the export process or is this just an edge case?Am I missing something and is there the possibility of converting from raw directly to
EditorState
?Thanks :)
The text was updated successfully, but these errors were encountered: