Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

concatenation of views before returning #495

Closed
iSimar opened this issue Mar 30, 2015 · 3 comments
Closed

concatenation of views before returning #495

iSimar opened this issue Mar 30, 2015 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@iSimar
Copy link

iSimar commented Mar 30, 2015

Hello there,

When we are returning from a render function is there a way to concatenate multiple view elements before returning.

Ex: let's say you want to generate Text elements using a for loop? Then returning it from a render function.

@kennydee
Copy link
Contributor

haha :) this is related to my demand on your github project : iSimar/HackerNews-React-Native#2 ?

I'm also interested in knowing how to achieve something like that :)

@vkurchatkin
Copy link
Contributor

This works just fine:

var text = ['aaaa', 'bbbb', 'cccc'];
    return (
      <View style={styles.container}>
        {text.map(t => <Text>{t}</Text>)}
      </View>
    );

@iSimar
Copy link
Author

iSimar commented Mar 30, 2015

Perfect, Thank you.

@iSimar iSimar closed this as completed Mar 30, 2015
@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants