MoroccanOSS / react-stoon

react-stoon is a handy toolbox of reusable Components that allow you to reduce boilerplate by writing less js inside of your React Components.
MIT License
29 stars 10 forks source link

add flatten flag to Repeat foreach #14

Open Amine-H opened 6 years ago

Amine-H commented 6 years ago

add a flag that flattens the prop that gets passed to Repeat's children

const MyList = (items) => {
   <Repeat foreach={items} flatten>
      <MyListItem />
   </Repeat>
}

const MyListItem = ({value}) => <Text>{value}</Text>