Skip to content

Instantly share code, notes, and snippets.

@eLafo
Created October 25, 2016 17:06
Show Gist options
  • Save eLafo/302a34483b897aa22a6ff5cbeb7e7e41 to your computer and use it in GitHub Desktop.
Save eLafo/302a34483b897aa22a6ff5cbeb7e7e41 to your computer and use it in GitHub Desktop.
// a functional component. Also named container
import {createStructuredSelector} from 'reselect';
import { bindActionCreators } from 'redux'
import { connect }from 'react-redux'
import {App} from '../components/App'
import {getAppUIState} from '../selectors';
import * as actions from '../actions';
const mapDispatchToProps = dispatch => ({
actions: bindActionCreators(actions, dispatch)
})
const mapStateToProps = createStructuredSelector({
app: getAppUIState
})
const AppContainer = connect(
mapStateToProps,
mapDispatchToProps
)(App)
export default AppContainer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment