Skip to content

Instantly share code, notes, and snippets.

@Kamilnaja
Last active July 30, 2017 17:09
Show Gist options
  • Save Kamilnaja/f7a93f302d76fca568480e92630b5991 to your computer and use it in GitHub Desktop.
Save Kamilnaja/f7a93f302d76fca568480e92630b5991 to your computer and use it in GitHub Desktop.
firstly, you should add lodash
export default class TodosList extends React.Component {
renderItems() {
return _.map(this.props.todos, (todo, index) => <TodosListItem key={index}{...todo} />)
}
render() {
return (
<table>
<TodosListHeader />
<tbody>
{this.renderItems()}
</tbody>
</table>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment