Skip to content

Instantly share code, notes, and snippets.

@jinook929
Created May 30, 2021 21:13
Show Gist options
  • Save jinook929/a2e18c8d3ea80f8312d099596fa8810d to your computer and use it in GitHub Desktop.
Save jinook929/a2e18c8d3ea80f8312d099596fa8810d to your computer and use it in GitHub Desktop.
React with Hooks, with Redux: Counter.js
...
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