Skip to content

Instantly share code, notes, and snippets.

@oreqizer
Created December 2, 2016 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oreqizer/f46d471eb99e59d2f9c86159dc34172a to your computer and use it in GitHub Desktop.
Save oreqizer/f46d471eb99e59d2f9c86159dc34172a to your computer and use it in GitHub Desktop.
An example of a context-less component with a selector.
// @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