Skip to content

Instantly share code, notes, and snippets.

@codemilli
Last active February 21, 2016 04:13
Show Gist options
  • Save codemilli/4d8222e3f2aae2d3a74d to your computer and use it in GitHub Desktop.
Save codemilli/4d8222e3f2aae2d3a74d to your computer and use it in GitHub Desktop.
todos 를 rendering 하는 컴포넌트
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