SHARE
TWEET

Untitled

a guest Aug 25th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  Adds an onChange event handler to the input element.
  3.  The handler just logs a message on the console.
  4.  */
  5.  
  6. import React from "react";
  7.  
  8. function TodoItem(props) {
  9.   return (
  10.     <div className="todo-item">
  11.       <input
  12.         type="checkbox"
  13.         checked={props.item.completed}
  14.         onChange={() => console.log("Changed!")}
  15.       />
  16.       <p>{props.item.text}</p>
  17.     </div>
  18.   );
  19. }
  20.  
  21. export default TodoItem;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top