Closed Yoruba closed 7 years ago
Hi @Yoruba!
We support atomic types with the atomicHandler()
parameter.
Check out this example.
Thanks for the response raphaelpor, you are right but some draft editors like medium draft use type atomic:image instead of image.
When that is the case the image is not render because there is no handler for atomic:image.
{ "key": "e4g3h", "text": "", "type": "atomic:image", "depth": 0, "inlineStyleRanges": [], "entityRanges": [], "data": { "src": "https://lorempixel.com/400/200/" } },
In the view I use
if (item.type === 'atomic:image') {
return (
<View key={item.key} style={{ flex: 1 }}>
<FitImage source={{ uri: item.data.src }} />
</View>
)
}
I'm sorry, @Yoruba. But we don't give support to other editors like "medium-draft". We do it only for draft.js editors.
Anyway, we think you can fork this project and do it by yourself.
Please add atomic:image to getBlocks.js to support other draft editors?
Thanks, Adri