Text component inside View with flexDirection set to row Text go off View.
I tried set flexWrap to wrap but it's still no working.
const tags = [
{ name: "condition", value: "99%" },
{ name: "cashback", value: "10%" },
{ name: "discount", value: "10%" }
];
<View style={{ flexDirection: "row" }}>
{tags.map((tag, i) => (
<View
key={i}
style={{
backgroundColor: "#FFECEC",
padding: 3,
borderRadius: 3,
marginRight: 3,
flexWrap: "wrap"
}}
>
<Text
style={{
fontSize: 12,
color: Theme.Primary,
}}
>
{`${tag.name.toUpperCase()} ${tag.value}`}
</Text>
</View>
))}
</View>
I want the last element to go to the second line but it just go off the screen.