convertFromRaw returns an Array of ContentBlocks not a ContentState #28
Comments
Great catch. It's a mistake in the docs. |
Ok, thanks... PR is in progress ;) |
[docs] Fix return type of convertFromRaw (See #28)
Hi there, There is still mistake in the docs: https://facebook.github.io/draft-js/docs/api-reference-data-conversion.html#content convertFromRaw(rawState: RawDraftContentState): ContentState |
Where? Can't find it. |
Here is a screenshot of this page: https://facebook.github.io/draft-js/docs/api-reference-data-conversion.html#content |
What do you think should be there instead? |
From conversation above instead of ContentState there should be array of ContentBlocks |
Ah, now I see. I had fixed this in PR. However, it was changed it back by @hellendag here This was because the return type has changed here. In PR #333 it was discussed a bit. So docs are correct. |
Oh, thanks. I used a 0.5.0 version and it was returning an array of ContentBlocks, so I thought that there is a mistake in docs. Now, after I've updated to 0.6.0 it works fine. |
Hi there,
As documented here the function
convertFromRaw
should return aContentState
object.However it returns an array of
ContentBlock
objects.This works:
However this throws an error:
Error:
Is this a mistake in the docs or a bug?
The text was updated successfully, but these errors were encountered: