Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react'
- import PropTypes from 'prop-types'
- const Todo = ({ onClick, completed, text }) => (
- <li
- onClick={onClick}
- style={{
- textDecoration: completed ? 'line-through' : 'none'
- }}
- >
- {text}
- </li>
- )
- Todo.propTypes = {
- onClick: PropTypes.func.isRequired,
- completed: PropTypes.bool.isRequired,
- text: PropTypes.string.isRequired
- }
- export default Todo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement