Created
July 20, 2018 20:46
-
-
Save kaiobrito/b0167a142a04e67741694af451137fdf to your computer and use it in GitHub Desktop.
TodoList + Redux
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
class TodoList extends React.Component { | |
static defaultProps = { | |
todos: {} | |
}; | |
render() { | |
return ( | |
<ul> | |
{this.props.todos | |
.valueSeq() | |
.map(todo => <li key={todo.get("id")}>{todo.get("text")}</li>)} | |
</ul> | |
); | |
} | |
} | |
const mapStateToProps = state => { | |
return { | |
todos: state.todos.get("items") | |
}; | |
}; | |
export default connect(mapStateToProps)(TodoList); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment