Guest User

Untitled

a guest
Feb 21st, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. // @flow
  2.  
  3. import React from 'react';
  4.  
  5. type Props = {
  6. tasks: Array<Object>,
  7. };
  8.  
  9. type State = {
  10. isInProgress: boolean
  11. }
  12.  
  13. class Task extends React.Component<Props, State> {
  14. constructor(props: Object) {
  15. super(props);
  16. this.state = { isInProgress: true };
  17. this.updateStatus = this.updateStatus.bind(this);
  18. }
  19. updateStatus = function () {
  20. this.setState({ isInProgress: !this.state.isInProgress });
  21. }
  22.  
  23. render() {
  24. return (
  25. <div className="tasks-wrapper">
  26. {this.props.tasks.map(task => (
  27. <SomeNewComponent stuff={stuff} />
  28. ))}
  29. </div>
  30. );
  31. }
  32. }
  33.  
  34. export default Task;
Add Comment
Please, Sign In to add comment