Created
July 29, 2015 16:14
-
-
Save isnifer/e2abf3869ce3dd998a46 to your computer and use it in GitHub Desktop.
This file contains hidden or 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, { Component } from 'react'; | |
import { bindActionCreators } from 'redux'; | |
import { Connector } from 'redux/react'; | |
import Header from '../components/Header'; | |
import MainSection from '../components/MainSection'; | |
import * as TodoActions from '../actions/TodoActions'; | |
export default class TodoApp extends Component { | |
render() { | |
return ( | |
<Connector select={state => ({ todos: state.todos })}> | |
{this.renderChild} | |
</Connector> | |
); | |
} | |
renderChild({ todos, dispatch }) { | |
const actions = bindActionCreators(TodoActions, dispatch); | |
return ( | |
<div> | |
<Header addTodo={actions.addTodo} /> | |
<MainSection todos={todos} actions={actions} /> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment