Categories
How to create elements in a loop?
render() { let result; for (let i = 0; i < 5; i++) { result += <Text>Hello</Text> } return ( <View> {result} </View> ); } }
Answer the question
In order to leave comments, you need to log in
[...Array(5)].map(() => <Text>Hello</Text>)
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question