Last active
December 1, 2016 17:09
-
-
Save oreqizer/aa3466c6588d33876bb74198a51f1487 to your computer and use it in GitHub Desktop.
An example of a simple component connected to Redux store.
This file contains 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 from 'react'; | |
import { connect } from 'react-redux'; | |
import { injectIntl } from 'react-intl'; | |
import messages from './messages'; | |
const TodoList = props => ( | |
<div className="TodoList"> | |
<h3>{props.intl.formatMessage(message.listHeader)}</h3> | |
{props.todos.map(todo => ( | |
<div className="TodoList-item" key={todo.id}> | |
{todo.text} | |
</div> | |
))} | |
</div> | |
); | |
export default injectIntl(connect(state => ({ | |
todos: state.todos.list, | |
})(TextField)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment