Skip to content

Instantly share code, notes, and snippets.

@jjn1056
Created October 4, 2018 21:55
Show Gist options
  • Select an option

  • Save jjn1056/3155bc2459bbf321795ffb14be380623 to your computer and use it in GitHub Desktop.

Select an option

Save jjn1056/3155bc2459bbf321795ffb14be380623 to your computer and use it in GitHub Desktop.
renderRow(data) {
return (
<Text>{`\u2022 ${data}`}</Text>
);
}
render() {
const { productDataLoaded } = this.state;
if (productDataLoaded === false) {
return <Text>No product scanned!</Text>;
}
return (
<View style={styles.productView}>
<Text style={{ color: 'black' }}>
PRODUCT NAME: {this.state.productData.product_name}
</Text>
<Text style={{ color: 'black' }}>
<ListView
style={{margin: 40}}
dataSource={this.state.productData.ingredients_text_en.split(',')}
renderRow={this.renderRow}
/>
</Text>
</View>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment