Skip to content

Instantly share code, notes, and snippets.

@teimurjan
Created May 21, 2018 07:00
Show Gist options
  • Save teimurjan/cd753db35b8170ee9767dda782ed6e3a to your computer and use it in GitHub Desktop.
Save teimurjan/cd753db35b8170ee9767dda782ed6e3a to your computer and use it in GitHub Desktop.
blog-react-applications-optimization
const TodoFactory = ({ todo, onClick }) => (
<li className="todo" onClick={onClick}>
{todo.title}
</li>
);
export default ({ todos }) => (
<ul>{todos.map(todo => TodoFactory({ todo, onClick: console.log }))}</ul>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment