Skip to content

Instantly share code, notes, and snippets.

@oreqizer
Last active December 1, 2016 17:09
Show Gist options
  • Save oreqizer/aa3466c6588d33876bb74198a51f1487 to your computer and use it in GitHub Desktop.
Save oreqizer/aa3466c6588d33876bb74198a51f1487 to your computer and use it in GitHub Desktop.
An example of a simple component connected to Redux store.
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