Skip to content

Instantly share code, notes, and snippets.

@balazimichal
Created July 21, 2018 06:58
Show Gist options
  • Save balazimichal/860ed2d4e626a13c83b5830236a17cd5 to your computer and use it in GitHub Desktop.
Save balazimichal/860ed2d4e626a13c83b5830236a17cd5 to your computer and use it in GitHub Desktop.
import React from 'react';
import { connect } from 'react-redux';
const ExpenseList = (props) => (
<div>
<h1>Expense List</h1>
{props.expenses.length}
{props.filters.text}
</div>
);
const mapStateToProps = (state) => {
return {
expenses: state.expenses,
filters: state.filters
}
}
const ConnectedExpenseList = connect(mapStateToProps)(ExpenseList);
export default ConnectedExpenseList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment