Last active
February 21, 2016 04:13
-
-
Save codemilli/4d8222e3f2aae2d3a74d to your computer and use it in GitHub Desktop.
todos 를 rendering 하는 컴포넌트
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PropTypes } from 'react'; | |
/** | |
* Define React Presentational Component Todos | |
*/ | |
const Todos = ({todos, onToggle }) => { | |
return ( | |
<ul> | |
{todos.map((todo) => ( | |
<li | |
key={todo.id} | |
onClick={() => onToggle(todo.id)} | |
style={{textDecoration: todo.completed ? 'line-through' : 'none'}}> | |
{todo.text} | |
</li> | |
))} | |
</ul> | |
); | |
}; | |
export default Todos; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment