title: I am getting initialization error in the following react-redux code
body: <p>I am getting the following Error: Reducer "counter" returned undefined during initialization  If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.
  This error is coming when I try to combine 2 reducers.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import counterReducer from "./counter"
  import loggedReducer from "./isLogged"
  import {combineReducers} from "redux"
  
  const allReducer = combineReducers({
      counterReducer,
      loggedReducer
  })
  
  export default allReducer</code></pre>
  </div>
  </div>
  
  My counter-reducer file code is :</p>
  
  <pre><code>const counterReducer = (state ={counter:0},action) =&gt;{
      switch(action.type){
          case "INCREMENT":
              return state.counter + 1
          case "DECREMENT":
              return state.counter - 1    
      }
  }
  export default counterReducer;
  </code></pre>
  
  <p>my index.js code is :</p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import './index.css';
  // import "bootstrap/dist/css/bootstrap.min.css"
  import App from './App';
  import * as serviceWorker from './serviceWorker';
  import {createStore} from "redux";
  import allReducer from "./Reducers"
  
  const store = createStore(allReducer);
  </code></pre>
  
  <p>Getting above mentioned error while running this last line.</p>