title: React / Redux: mapStateToProps not actually mapping state to props
body: <p>I'm using React and Redux on a project, and I'm having problems implementing a feature to enable/disable a button. I've been able to:</p>
  
  <ul>
  <li>trigger a method</li>
  <li>have that method trigger an action creator</li>
  <li>dispatch an action</li>
  <li>catch that action in the reducer and create a new, updated state</li>
  <li>see the updated state in Redux DevTools</li>
  </ul>
  
  <p>However, the enable/disable functionality still doesn't work, as it seems that <code>mapStateToProps</code> and <code>connect</code> aren't actually mapping the state to the props. I'm tracking <code>canSubmit</code>, which changes within the state but is <code>undefined</code> in the props. What am I missing to successfully map the state to the props?</p>
  
  <p>Relevant code:</p>
  
  <p>UserFormView.js</p>
  
  <pre><code>const mapStateToProps = (state) =&gt; ({
    routerState: state.router,
    canSubmit: state.canSubmit
  });
  const mapDispatchToProps = (dispatch) =&gt; ({
    actions: bindActionCreators(ActionCreators, dispatch)
  });
  
  class UserFormView extends React.Component {
  </code></pre>
  
  <p>...</p>
  
  <pre><code>}
  
  export default connect(mapStateToProps, mapDispatchToProps)(UserFormView);
  </code></pre>
  
  <p>Actions:</p>
  
  <pre><code>export function enableSubmit(payload) {
    return {
      type: ENABLE_SUBMIT,
      payload: payload
    };
  }
  
  export function disableSubmit(payload) {
    return {
      type: DISABLE_SUBMIT,
      payload: payload
    };
  }
  </code></pre>
  
  <p>Reducer (using a createReducer helper function):</p>
  
  <pre><code>const initialState = {
    canSubmit: false
  };
  
  export default createReducer(initialState, {
  
    [ENABLE_SUBMIT]: (state) =&gt; {
      console.log('enabling');
      return Object.assign({}, state, {
        canSubmit: true
      });
    },
  
    [DISABLE_SUBMIT]: (state) =&gt; {
      console.log('disabling');
      return Object.assign({}, state, {
        canSubmit: false
      });
    }
  
  });
  </code></pre>