Created
October 30, 2018 18:00
-
-
Save Auskennfuchs/992ac0d4e8862f2648b039bedf5fdb0d to your computer and use it in GitHub Desktop.
redux connect
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
| class Media extends React.Component { | |
| ... | |
| onClick = () => { | |
| this.props.onUpdateMedia({ | |
| value: "Test" | |
| }) | |
| } | |
| render() { | |
| const {media} = this.props | |
| } | |
| } | |
| const mapState = ({media})=>({media}) | |
| const mapDispatch = (dispatch)=>({ | |
| onUpdateMedias: (data) => dispatch(updateMedia(data)) | |
| }) | |
| export default connect(mapState,mapDispatch)(Media) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment