Quantcast
Channel: Give different style to each element in an array React native - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Answer by sver for Give different style to each element in an array React native

I do the following :switch(key){ case 0: return(<FieldListItem itemStyle={{fontSize:20,color:'black', fontWeight:'bold'}} key={key} field={field}></FieldListItem>); case 1:...

View Article



Answer by Parsa Arvaneh for Give different style to each element in an array...

Give your return element an id with a unique value, you can use key since you are already using it.return(<Text id=`text{this.props.key}`>types<Text>)}And in your style.css file, have sth...

View Article

Answer by Ravi for Give different style to each element in an array React native

You can define custom styles in style-sheet or directly declare it inside component.render() { let types = this.props.field.type let itemStyle = {} switch(type) { case 'type1': itemStyle={fontSize:10}...

View Article

Give different style to each element in an array React native

I am displaying an array like so : this.props.group.fields.slice(0,3).map((field, key)=>{ return( <View style= {styles.cardContainerStyle}><FieldListItem key={key} field...

View Article
Browsing latest articles
Browse All 4 View Live




Latest Images