Skip to content

Instantly share code, notes, and snippets.

@fdjones
Created February 17, 2018 13:47
Show Gist options
  • Save fdjones/9fbfa5b24906a8f69b32e3bff870676a to your computer and use it in GitHub Desktop.
Save fdjones/9fbfa5b24906a8f69b32e3bff870676a to your computer and use it in GitHub Desktop.
import React from 'react';
import Task from './Task';
// type tTask = {
// title: string,
// details: string,
// ID: number
// }
// type tProps = {
// tasks: Array<tTask>,
// };
class TaskList extends React.Component {
constructor(props) {
super(props);
this.updateStatus = this.updateStatus.bind(this);
this.state = {
isInProgress: true,
};
}
updateStatus() {
this.setState({ isInProgress: !this.state.isInProgress });
}
render() {
return (
<div className="tasks-wrapper">
{this.props.tasks.map(task => (
<Task
taskData={task}
onClick={this.updateStatus}
/>
))}
</div>
);
}
}
export default TaskList;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment