title: How to hide/display separate forms using buttons and redux?
body: <p>I'm new to react and redux (and posting on stack overflow!).</p>
  
  <p>I'd like to hide/display a redux-form based on a button choice.</p>
  
  <p>I have two buttons: Option-A and Option-B.</p>
  
  <p>I followed the redux tutorial exactly to have their onClick methods dispatch <code>setVisibilityFilter(buttonprops.filter)</code> through a container. <a href="https://redux.js.org/basics/exampletodolist" rel="nofollow noreferrer">See: FilterLink.js</a> This works fine and updates the state's visibilityFilter with the corresponding option.</p>
  
  <p>However, I'm stuck about how I should access the state's filter to hide/display different forms. I would like something similar to what formValueSelector does, but it isn't applicable for buttons (because they don't return values?)</p>
  
  <p>This is my main component's code:</p>
  
  <pre><code>class MainForm extends Component {
    render() {
      const { error } = this.props
      return ( 
        &lt;Grid.Column width={9}&gt;
          &lt;Button.Group floated='right'&gt;
          &lt;FilterLink filter={VisibilityFilters.SHOW_A}&gt;A&lt;/FilterLink&gt;
          &lt;Button.Or /&gt;
          &lt;FilterForm filter={VisibilityFilters.SHOW_B}&gt;B&lt;/FilterLink&gt;
          &lt;/Button.Group&gt;
          /* If SHOW_A, display FORM_A, else if SHOW_B, display FORM_B */
      &lt;/Grid.Column&gt; 
    )
  }}
  </code></pre>
  
  <p>I feel like just toying with the state directly now would waste the effort of implementing redux. I think I should be passing the value as a prop down to the child forms, but I'm confused how to do so, especially because I don't know how I would get that value without changing my onClick anyway, and onClick is already defined in FilterLink.js</p>
  
  <p>There must be some way to access my state visibility filter to hide/display a form, just unsure how to get there. Thank you!</p>