This repository was archived by the owner on Dec 29, 2022. It is now read-only.
now accepts draftjs model as input, stringified model#32
Open
cherucole wants to merge 1 commit intoreact-native-toolkit:setup-bobfrom
Open
now accepts draftjs model as input, stringified model#32cherucole wants to merge 1 commit intoreact-native-toolkit:setup-bobfrom
cherucole wants to merge 1 commit intoreact-native-toolkit:setup-bobfrom
Conversation
DaniAkash
reviewed
Oct 15, 2020
Member
DaniAkash
left a comment
There was a problem hiding this comment.
The code seems to introduce breaking changes. Please check my comments @cherucole
| try { | ||
| if (data) { | ||
| setEditorState(EditorState.createWithContent(stateFromHTML(data))); | ||
| const stateFromBlob = convertFromRaw(JSON.parse(data)); |
Member
There was a problem hiding this comment.
We already have the text editor running for other people that uses HTML as the default input.
We probably have to keep using html as the default data for the inputs. However, provide an additional layer that will accept default value using different formats.
For eg:
If the user provides defaultValue as a string, it will accept the value as HTML.
To provide defaultValue as Markdown, Raw or HTML, we can have an object, that receives the data as
{type: "md", value: "value as markdown"}
{type: "raw", value: "value as raw stringified object"}
{type: "html", value: "value as html"}
| import { ICustomWindow } from './types/ICustomWindow'; | ||
|
|
||
| declare let window: ICustomWindow; | ||
| const blob = |
Member
There was a problem hiding this comment.
Not sure why we need this data for...
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi Dani, this is the fix for making the library accept input of type 'draft-js' model instead of html so no need to convert to editor-state using additional libraries and also extracting plain text as well