Closed RGBboy closed 6 years ago
Hmm, iirc this was an issue before as well, which is why (at least the intention was) to not nest images in Text components anyway. Apparently there are cases where that still happens.
Could you share the input markdown that's causing this?
Sure, it is literally just an image:
![Test](https://placehold.it/320x320)
When in debug mode I get this:
==== LOGGING NODE TREE ===
Utils.js:43 > block_0, NODE TYPE: Text
Utils.js:43 > imageWrapper_0_0, NODE TYPE: undefined
Just had a deeper look and it looks like the problem is coming from the isTextOnly
method in Utils.js. It seems like line 8:
nodes[i].type.hasOwnProperty('displayName'))
is returning false
, causing the method to return true
. Also looks like ReactNative does not have displayName
anywhere on the type
property. It may be better to inspect name
instead.
Hmm, I'll have a look, that might have changed. Thanks for the details!
I pushed a fix to the master branch (removed the isTextOnly from use entirely). I'm unable to test it as I haven't upgraded any of my apps past RN 0.51, would you mind giving it a go?
I can confirm this fixes the issue.
Thanks. This fix is now published as 1.2.0 in npm.
Essentially embedding any image in the markdown causes the following error on Android:
This stems from the fact that View components are nested within Text components, which is no longer supported on Android.