0
I have the function sequinte, that does not work.
textao() {
var texto = <Text>Texto1</Text>;
var texto2 = <Text>Texto2</Text>;
return texto + texto2;
}
I want to concatenate two components. I know I could do it like this:
textao() {
var texto = <View><Text>Texto1</Text><Text>Texto2</Text></View>;
return texto;
}
But I intend to make loops and recursive functions. Is there any way to concatenate two components? Or else some function like append
which causes one component to insert another in?
I thought I’d do it like this:
concatena(c1, c2) {
return <View>{c1}{c2}</View>
}
But I thought I pushed too hard.