title: How to change a button using Redux
body: <p>I need your help.
  I have an assignment, create two buttons(these buttons are initially white background).
  When I click on one of them, I need both buttons to change color, using Redux.
  The buttons I created. I don't know how to change the color.
  Can anyone help? I would really appreciate it.</p>
  <p>this is my code</p>
  <pre><code>import { COUNTER_GREEN, COUNTER_RED } from &quot;../constants&quot;;
  
  export const actionRed = () =&gt; ({
  
      type: COUNTER_RED
  
  });
  
  export const actionGreen = () =&gt; ({
  
      type: COUNTER_GREEN
  
  });
  =========================
  import React from &quot;react&quot;;
  import { connect } from &quot;react-redux&quot;;
  
  import { actionGreen, actionRed } from &quot;../../actions/counter&quot;;
  
  const Counter = ({ actionRed, actionGreen }) =&gt; {
      return (
          &lt;div&gt;
              &lt;button onClick={actionRed}&gt;Red&lt;/button&gt;
  
              &lt;button onClick={actionGreen}&gt;Green&lt;/button&gt;
          &lt;/div&gt;
      );
  }
  
  const mapStateToProps = () =&gt; ({});
  
  const mapDispatchToProps = {
      actionRed,
      actionGreen
  };
  
  export const CounterContainer = connect(mapStateToProps,mapDispatchToProps)(Counter);
  ======================
  
  
  const red = 'red';
  const green = 'green';
  
  const redtest = {
  color: 'red'
  }
  
  
  export const counterReducer = (state={redtest}, action) =&gt; {
      switch(action.type) {
          case &quot;COUNTER_RED&quot;: {
              return {
                  state: {redtest}
              };
  
          }
          case &quot;COUNTER_GREEN&quot;: {
              return {
                  state:green
  
  
              };
          }
          default: {
              return state;
          }
      }
  };
  
  
  </code></pre>