Skip to content

Instantly share code, notes, and snippets.

@fdjones
Created February 20, 2018 20:51
Show Gist options
  • Save fdjones/fe6ce5313531ac0fd4c0b36e43dcce76 to your computer and use it in GitHub Desktop.
Save fdjones/fe6ce5313531ac0fd4c0b36e43dcce76 to your computer and use it in GitHub Desktop.
import React from 'react';
import Task from './Task';
import PropTypes from 'prop-types';
class TaskList extends React.Component {
// eslint-disable-next-line react/sort-comp
constructor(props) {
super(props);
TaskList.updateStatus = TaskList.updateStatus.bind(this);
}
static updateStatus(arg) {
console.log(arg);
}
render() {
return (
<div className="tasks-wrapper">
{this.props.tasks.map(task => (
<Task
taskData={task}
updateStatus={TaskList.updateStatus}
key={task.ID}
/>
))}
</div>
);
}
}
TaskList.propTypes = {
tasks: Object.isRequired,
};
export default TaskList;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment