niuware / mui-rte

Material-UI Rich Text Editor and Viewer
MIT License
437 stars 168 forks source link

Passing contentstate object instead of sringified value #301

Closed prionkor closed 2 years ago

prionkor commented 2 years ago

Checklist

Description

Currently we provide a value (defaultValue which is a stringified version of the content state). Each time content changes it returns a content states in onChange and if you save it in a state which passes as defaultValue you will have to stringify again.

Suggestion

Allow contentState object as defaultValue or perhaps a separate props contentState

prionkor commented 2 years ago

draftEditorProps can be used

<RichTextEditor
    draftEditorProps={{
        editorState,
    }}
/>