mh108
8/13/2019 - 7:48 PM

TodoItem.js

/**
 Adds an onChange event handler to the input element.
 The handler just logs a message on the console.
 */

import React from "react";

function TodoItem(props) {
  return (
    <div className="todo-item">
      <input
        type="checkbox"
        checked={props.item.completed}
        onChange={() => console.log("Changed!")}
      />
      <p>{props.item.text}</p>
    </div>
  );
}

export default TodoItem;