redux, state, and you

import { createStore } from 'redux'
import reducers from './reducers'
import state from './state'
export default createStore(reducers, state)
import { connect } from 'react-redux'
import DumbComponent from '../components/DumbComponent'
import { anAction } from '../redux/actions'
const mapStateToProps = (state) => {
return {
newPropforThatDumbComponent: state.someProperty
}
}
const mapDispatchToProps = (dispatch) => {
return {
anotherNewProp: () => dispatch(anAction())
}
}
export default connect(mapStateToProps, mapDispatchToProps)(DumbComponent)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Michael Scoggins

Michael Scoggins

graduate of Austin Coding Academy. looking for a full-stack (MERN... with a flexible M) web dev position.