I have something like
<View style={{flexDirection:'row'}}>
<Image source = {require('./img/img1.jpg')}/>
<HTML html ={htmlbody}/>
</View>
It renders an image and html text next to it, but I want to wrap the html under the image and continue there like :
IMG TT TTT TTT
IMG TTTTTT TTT
IMG TTT TTTT T
TTTTT T TTTTTT
TTTTT T TTT TT
Is this possible and if so how? I use HTML from react-native-render-html but am not bound to it?
Images are all locally stored and I can form the hmltbody like I want.
I think the only way render actual HTML around the image would be to either move the image to react-native-render-text (which may pose issues for referencing a local file; I’m not sure), or moving everything (image and html) to a WebView. Or turn your HTML into native views/ text.
Since the HTML component is a single sibling of Image, they’re restricted to relating to each other the way any other set of sibling components inside a View would relate, via style props like flexDirection
, justifyContent
, alignItems
.
So, you could pretty easily do:
IMG IMG IMG TTT TTT TTT TTT
or
IMG IMG IMG
TTT TTTT TT
but I can’ think of any case where a single sibling component can wrap around another sibling.