title: can't map state to props when using combinereducers
body: <p>I'm trying to map my state to a given component with redux. I have two reducers and are therefore using combineReducers before passing my rootReducer to my store.</p>
  
  <pre><code>const rootReducer = combineReducers({
      ctr:counter,
      res:result
  });
  
  const store = createStore(
      rootReducer,
      window.__REDUX_DEVTOOLS_EXTENSION__ &amp;&amp; window.__REDUX_DEVTOOLS_EXTENSION__()
  );
  
  ReactDOM.render(&lt;Provider store={store}&gt;&lt;App/&gt;&lt;/Provider&gt;, document.getElementById('root'));
  registerServiceWorker();
  </code></pre>
  
  <p>But when I try mapping my state to a given component's props, the state is undefined</p>
  
  <pre><code>const mapStateToProps = state =&gt; {
      return {
          ctr: state.ctr.counter,
          storedResults: state.res.results //storedResults is undefined when I try to access it.
      }
  };
  </code></pre>
  
  <p>My two reducers look as follows:</p>
  
  <p><strong>counter.js</strong></p>
  
  <pre><code>import * as actionTypes from "../actions";
  
  
  const initialState = {
      counter:0
  };
  
  const reducer = (state = initialState, action) =&gt; {
  
      switch (action.type) {
          case actionTypes.INCREMENT:
              return {
                  ...state,
                  counter: state.counter + 1
              };
          case actionTypes.DECREMENT:
              return {
                  ...state,
                  counter: state.counter - 1
              };
          case actionTypes.ADD:
              return {
                  ...state,
                  counter: state.counter + action.val
              };
          case actionTypes.SUBTRACT5:
              return {
                  ...state,
                  counter: state.counter - 5
              };
      }
  
      return state;
  };
  
  
  export default reducer;  
  </code></pre>
  
  <p><strong>result.js</strong></p>
  
  <pre><code>import * as actionTypes from "../actions";
  
  
  const initialState = {
      result:[]
  };
  
  const reducer = (state = initialState, action) =&gt; {
  
      switch (action.type) {
          case actionTypes.STORE_RESULT:
              return {
                  ...state,
                  results:state.results.concat({id: new Date(), value:state.counter})
              };
          case actionTypes.DELETE_RESULT:
              // const id = 2;
              // const newArray = [...state.results];
              // newArray.splice(id,1);
  
              const updatedArray = state.results.filter(result =&gt; result.id !== action.resultId);
  
              return {
                  ...state,
                  results:updatedArray
              }
  
      }
  
      return state;
  };
  
  
  export default reducer;
  </code></pre>
  
  <p>Any idea what the problem might be?</p>