Skip to content

Instantly share code, notes, and snippets.

@fdjones
Created February 8, 2018 16:20
Show Gist options
  • Save fdjones/e4883af3155fc5a78ab6fb0d29dcab52 to your computer and use it in GitHub Desktop.
Save fdjones/e4883af3155fc5a78ab6fb0d29dcab52 to your computer and use it in GitHub Desktop.
// @flow
import React from 'react';
type Props = {
tasks: Array<Object>,
};
type State = {
isInProgress: boolean
}
class Task extends React.Component<Props, State> {
constructor(props: Object) {
super(props);
this.state = { isInProgress: true };
this.updateStatus = this.updateStatus.bind(this);
}
updateStatus = function () {
this.setState({ isInProgress: !this.state.isInProgress });
}
render() {
return (
<div className="tasks-wrapper">
{this.props.tasks.map(task => (
<SomeNewComponent stuff={stuff} />
))}
</div>
);
}
}
export default Task;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment