Created
February 12, 2016 14:01
-
-
Save codemilli/ccd09bb26a82b76a0b5b to your computer and use it in GitHub Desktop.
component 를
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
/** | |
* Created by youngmoon on 2/12/16. | |
*/ | |
import React from 'react'; | |
import { bindActionCreators } from 'redux'; | |
import { connect } from 'react-redux'; | |
import * as ActionCreators from '../actions'; | |
import Add from '../components/add'; | |
import Todos from '../components/todos'; | |
import Header from '../components/header'; | |
/** | |
* Define React Presentational Component App | |
*/ | |
const App = (props) => { | |
const {onToggle, onSubmit, setVisible, visible, todos} = props; | |
return ( | |
<div> | |
<Header setVisible={setVisible} visible={visible} /> | |
<Add onSubmit={onSubmit} /> | |
<Todos visible={visible} todos={todos} onToggle={onToggle} /> | |
</div> | |
); | |
}; | |
const mapStateToProps = (state) => { | |
return { | |
todos: state.todos, | |
visible: state.visible | |
}; | |
}; | |
const mapDispatchToProps = (dispatch) => { | |
return bindActionCreators(ActionCreators, dispatch); | |
}; | |
export default connect( | |
mapStateToProps, | |
mapDispatchToProps | |
)(App); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment