Task.jsx 347 B

123456789101112131415
  1. // Task component: represents a single todo item.
  2. Task = React.createClass({
  3. propTypes: {
  4. // This component gets the task to display through a React prop.
  5. // We can use propTypes to indicate it is required.
  6. task: React.PropTypes.object.isRequired
  7. },
  8. render() {
  9. return (
  10. <li>{this.props.task.text}</li>
  11. );
  12. }
  13. });