title: Action not passed to Reducer in Redux using React
body: <p>I am writing a code to apply a theme using redux.
  Here is my code:</p>
  
  <p>Actions/index.js</p>
  
  <pre><code>export const CHANGE_THEME = 'CHANGE_THEME';
  
  export const changeTheme = (payload) =&gt; {
    console.log('payload ' + payload)
    return ({
    type: CHANGE_THEME,
    payload
  })}
  </code></pre>
  
  <p>Reducers/index.js</p>
  
  <pre><code>import { combineReducers } from 'redux'
  import themeChangeHandler from './themeChangeHandler'
  
  const rightBarMenuHandler = combineReducers({
    themeChangeHandler
  })
  
  export default rightBarMenuHandler
  </code></pre>
  
  <p>themeChangeHandler.js</p>
  
  <pre><code>const themeChangeHandler = (state = 'light', action) =&gt; {
     console.log('rec action ' + action.type)
  
    switch(action.type) {
      case 'CHANGE_THEME':
        return action.payload
  
      default:
        return state
    }
  }
  
  export default themeChangeHandler
  </code></pre>
  
  <p>The event is using Menu/MenuItem</p>
  
  <pre><code>class AppBarRightButtonsMenu extends Component {
      constructor(props) {
            super(props);
          }
          onClickButton = (data) =&gt; {
            this.props.dispatch(changeTheme('dark'))
          }
          render() {
            const {onThemeChange, onLogout, dispatch} = this.props;
            var i = 1;
            if(NavigationButtonMenu) {
              var list = NavigationButtonMenu.map( (menuItem) =&gt; {
                return &lt;MenuItem key={i++} primaryText={menuItem.name} onClick = {this.onClickButton}/&gt;;
                });
                  return &lt;Menu &gt;{list}&lt;/Menu&gt;;
                } else {
                  return &lt;div/&gt;
                }
       }
    }
  export default connect()(AppBarRightButtonsMenu);
  </code></pre>
  
  <p>App.js</p>
  
  <pre><code>const App = ({theme}) =&gt; (
     &lt;SomeComp
        theme={theme}
     /&gt;
  function mapStateToProps(state) {
    console.log('state.themeChangeHandler ' + state.themeChangeHandler)
      return {
          theme: state.themeChangeHandler === 'dark'?darkBaseTheme:customTheme,
      };
  }
  
  export default connect(mapStateToProps, null) (App);
  </code></pre>
  
  <p>Adding store</p>
  
  <pre><code>const store = createStore(reducers)
  ReactDOM.render(&lt;Provider store={store}&gt;
    &lt;App /&gt;
  &lt;/Provider&gt;, document.getElementById('root'));
  registerServiceWorker();
  </code></pre>
  
  <p>I just get the console logs in the action but not the one in reducer(i get test log of reducer on the bootup). What am I doing wrong?</p>