Stop View flexing react native

How do I make the View not flex and take size of the content Inside in react native.

React Native


You can set the alignSelf style property to flex-start. for example:

<View style={{ alignSelf: 'flex-start' }}>...</View>

alignSelf controls how a child aligns in the cross direction, overriding the alignItems of the parent. It works like align-self in CSS (default: auto). See https://developer.mozilla.org/en-US/docs/Web/CSS/align-self for more details.