Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

convertFromRaw returns Array and not ContentState #43

Closed
davisml opened this issue Feb 23, 2016 · 1 comment
Closed

convertFromRaw returns Array and not ContentState #43

davisml opened this issue Feb 23, 2016 · 1 comment

Comments

@davisml
Copy link

davisml commented Feb 23, 2016

From the documentation

convertFromRaw(rawState: RawDraftContentState): ContentState
Given a raw state, convert it to ContentState object. This is useful when restoring contents to use within a Draft editor.

From my testing, convertFromRaw actually returns an Array of ContentBlock objects. To convert this back to a ContentState you must do the following:

ContentState.createFromBlockArray(convertFromRaw(rawData))

@hellendag
Copy link

#30 resolved this. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants