0

I have an array of strings that I would like to display on screen on multiple lines in React Native for iOS. In my Text view, I currently only have the one line of code:

<Text style={styles.text}>
  {this.state.selectData}
</Text>

I would like to display 3 elements of the selectData array per line, but I can't figure out how to go about executing it.

1 Answer 1

1

Something like this

render(){
   <View>
     {this.state.selectData.map((value, index) => {
         return (
             <Text key={index}>
                {value}
             </Text>
          );
         })
      }
     </View>
    );
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.