Guest User

Untitled

a guest
Oct 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. //Function
  2. const getThingName = (allCategories, id) => {
  3. const categoryName = _.find(allCategories, {items: [{id}]}).name;
  4. return categoryName;
  5. }
  6.  
  7. //Component
  8. const ThingsListView = ({ allCategories, .... }) => {
  9.  
  10. console.log(JSON.stringify(allCategories))
  11.  
  12. return (
  13. <ScrollView>
  14. <View>
  15. ...
  16. {(thingsByUser &&
  17. thingsByUser.length && (
  18. <List>
  19. {thingsByUser.map(({ id }, idx) => (
  20. ...
  21. <CardText>{getThingName(allCategories, id)}</CardText>
Add Comment
Please, Sign In to add comment