Created
June 14, 2019 04:17
-
-
Save charly-palencia/bcda65d3d9ed641ee2b5c5078f9b3ae6 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 from "react"; | |
| import { connect } from "react-redux"; | |
| ... | |
| import {fetchColor} from "./actions"; | |
| ... | |
| function App({fetchColor, color}) { | |
| return ( | |
| <AppContainer> | |
| ... | |
| <Router> | |
| <Header color={color} onClick={fetchColor}> | |
| ... | |
| </Header> | |
| </Router> | |
| </AppContainer> | |
| ); | |
| } | |
| function mapStateToProps(state) { | |
| return { | |
| color: state.color.color, | |
| }; | |
| } | |
| const mapDispatchToProps = { | |
| fetchColor, | |
| }; | |
| export default connect(mapStateToProps, mapDispatchToProps)(App); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment