title: Having issues with dispatch method after implementing immutable.js for state tree
body: <p>I started out with a simple react-redux application where in the state tree was made immutable through Object.assign(). The application seemed to work perfectly. As apart my next requirements iteration, the state tree was made immutable by using immutable  js. The following was how it was implemented as immutable state tree.</p>
  
  <pre><code>//user.js - reducer
  import { Map } from 'immutable';
  import  { setCompanyName, setCompanyMessage,
  setUserName , setJobTitle ,
  setAddressLine1, setAddressLine2,
  setPhoneNumber, setEmailAddress,
  setWebAddress } from './user-action-handlers.js';
  
  const user = (state = Map({}), action)=&gt; {
  
  switch(action.type){
      case 'SET_COMPANY_NAME':
          return  setCompanyName(
              state, 
              action.companyName
           );
  
      default: 
          return state;
   }
  
  }
  
  export default user;
  
  
  //user-action-handler.js
  import { Map } from 'immutable';
  
  export const setCompanyName = (currentState = {}, name = '')=&gt; {
    return  currentState.set('companyName',name);
  }
  </code></pre>
  
  <p>My component is trying to open a modal dialog (react-modal - <a href="https://github.com/reactjs/react-modal" rel="nofollow">https://github.com/reactjs/react-modal</a>) by subscribing to an event. as follows:</p>
  
  <pre><code>visibilityController: function() {
      if (this.store.getState().get('textEditorVisiblityFilter') ===    'SHOW_TEXT_EDITOR') {
          this.openModal();
      } else {
          this.closeModal();
      }
  
  },
  componentDidMount: function() {
  
      this.store = this.context.store;
      this.store.subscribe(this.visibilityController);
  
  },
  </code></pre>
  
  <p>The following is how i dispatch the action from my other component.</p>
  
  <pre><code>let EditorToolBar = ({
      dispatch
  }) =&gt; {
  
      let toolbarBtnStyle = className('btn btn-primary toolbar-button', styles.editorToolBarBnt);
      return (
          &lt;div className="container" &gt;
          &lt;div className= "row"&gt;
              &lt;div className="col-md-12"&gt;
                  &lt;div&gt;
                      &lt;button type="button" className={ toolbarBtnStyle } id="toolbar-text"
                          onClick={
                                  ()=&gt; {  
                                  dispatch(setVisiblityFilterForTextEditor('SHOW_TEXT_EDITOR'))
                              }
                              }&gt;
                          &lt;span className="glyphicon glyphicon-font"&gt;&lt;/span&gt;
                      &lt;/button&gt;       
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
      );
  } //class ends
  
  EditorToolBar = connect()(EditorToolBar);
  export default EditorToolBar;
  </code></pre>
  
  <p>I keep getting the following warning every time the message is dispatched. </p>
  
  <pre><code>Warning: setState(...): You passed an undefined or null state object; instead, use forceUpdate().
  </code></pre>
  
  <p>I am pretty sure this started happening after immutable js was introduced. 
  I am struck here and seems to be losing a lot of time and energy. Did i mentioned that this is my first attempt at Redux ?</p>
  
  <p>Please let me know if you need any further details.</p>