Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // @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;
Add Comment
Please, Sign In to add comment