title: How to communicate UI state changes between React components with Redux?
body: <p>as far as I understood Redux it is about keeping all state of the UI in one store (to be able to reproduce certain states easily and to have no side-effects). You can manipulate the state via triggering actions which trigger reducers.</p>
  
  <p>I am currently writing a small blog-like app where you can simply create and edit posts. I have a dialog for creating a post, roughly the <code>render</code> method of the <code>App</code> component returns something like this:</p>
  
  <pre><code>&lt;div&gt;
      &lt;AppBar ... /&gt;
      &lt;PostFormDialog
        addPost={actions.addPost}
        ref="postFormDialog" /&gt;
      &lt;PostList
        posts={posts}
        actions={actions} /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My question is: should the state of the dialog (opened or closed) be part of the state object of the App component? And should therefore opening and closing the dialog be triggered via an action instead of doing something like the following:</p>
  
  <pre><code>onTriggerCreatePostDialog(e) {
      this.refs.postFormDialog.show();
  }
  </code></pre>
  
  <p>where <code>onTriggerCreatePostDialog</code> is triggered via some click listener on a "create" button or so.</p>
  
  <p>It seems a little bit strange to me to do it via an actions because is introduces kind of an "indirection".</p>
  
  <p>However, assuming that I want to reuse the dialog for the edit action, I must be able to open the dialog from elements which are deeper in the component structure, for example from a <code>Post</code> component which is a child of the <code>PostList</code> component. What I could do is pass the <code>onTriggerCreatePostDialog</code> function down the hierarchy via the <code>props</code> property, but that seems cumbersome to me...</p>
  
  <p>So int the end is is also about communicating between components which are not in a direct parent-child relationship. Are there other options? Should I somehow utilise a global event bus? I am quite unsure currently.</p>