mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-14 13:14:30 -08:00
redux example init
This commit is contained in:
21
docs/examples/todos/src/components/Todo.js
Normal file
21
docs/examples/todos/src/components/Todo.js
Normal file
@@ -0,0 +1,21 @@
|
||||
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
|
||||
Reference in New Issue
Block a user