Skip to content

Instantly share code, notes, and snippets.

@duke79
Created January 1, 2020 16:56
Show Gist options
  • Save duke79/2aa145153a29c0f14858f568590916b2 to your computer and use it in GitHub Desktop.
Save duke79/2aa145153a29c0f14858f568590916b2 to your computer and use it in GitHub Desktop.
Redux in 30 seconds {PART 3}
import { connect } from 'react-redux';
const = MyComponent => (props) {
props.dispatch('MY_ACTION_STRING', {/*some data*/});
return null;
}
const mapStateToProps = function(state) {
return {
reduxState: state,
}
}
export default connect(mapStateToProps)(MyComponent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment