Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import React from 'react'
  2. import PropTypes from 'prop-types'
  3.  
  4. const Todo = ({ onClick, completed, text }) => (
  5. <li
  6. onClick={onClick}
  7. style={{
  8. textDecoration: completed ? 'line-through' : 'none'
  9. }}
  10. >
  11. {text}
  12. </li>
  13. )
  14.  
  15. Todo.propTypes = {
  16. onClick: PropTypes.func.isRequired,
  17. completed: PropTypes.bool.isRequired,
  18. text: PropTypes.string.isRequired
  19. }
  20.  
  21. export default Todo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement