Created
May 30, 2021 21:13
-
-
Save jinook929/a2e18c8d3ea80f8312d099596fa8810d to your computer and use it in GitHub Desktop.
React with Hooks, with Redux: Counter.js
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
... | |
import {connect} from 'react-redux' | |
const Counter = (props) => { | |
return ( | |
<div className="Counter"> | |
<h1>{props.count}</h1> | |
<Controllers /> | |
</div> | |
) | |
} | |
const mapStateToProps = state => { | |
return { | |
count: state.count | |
} | |
} | |
export default connect(mapStateToProps)(Counter) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment