Created
December 2, 2016 13:37
-
-
Save oreqizer/f46d471eb99e59d2f9c86159dc34172a to your computer and use it in GitHub Desktop.
An example of a context-less component with a selector.
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
// @flow | |
import React from 'react'; | |
import Todo from '../containers/Todo'; | |
import todoSelector from './todoSelector'; | |
type Props = { | |
filter: string, | |
header: string, | |
todos: Todo[], | |
} | |
const TodoList = (props: Props) => ( | |
<div className="TodoList"> | |
<h3>{props.header}</h3> | |
{todoSelector(props).map(todo => ( | |
<div className="TodoList-item" key={todo.id}> | |
{todo.text} | |
</div> | |
))} | |
</div> | |
); | |
export default TextField; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment