title: React Upvote & Downvote divs to vote only once
body: <p>I have a reddit like post where I can Upvote and downvote.</p>
  <pre><code>&lt;div className=&quot;post-card__vote-container&quot;&gt;
              &lt;div
                onClick={() =&gt;
                  dispatch(
                    updateVoteCount({ id: props.id, vote: ActionTypes.UP_VOTE })
                  )
                }
                className=&quot;post-card__icon&quot;
              &gt;
                &lt;Icon
                  icon=&quot;akar-icons:arrow-up&quot;
                  color=&quot;gray&quot;
                  width=&quot;50&quot;
                  height=&quot;50&quot;
                /&gt;
              &lt;/div&gt;
              &lt;div className=&quot;post-card__vote-count&quot;&gt;{props.voteCount}&lt;/div&gt;
              &lt;div
                onClick={() =&gt;
                  dispatch(
                    updateVoteCount({ id: props.id, vote: ActionTypes.DOWN_VOTE })
                  )
                }
                className=&quot;post-card__icon&quot;
              &gt;
                &lt;Icon
                  icon=&quot;akar-icons:arrow-down&quot;
                  color=&quot;gray&quot;
                  width=&quot;50&quot;
                  height=&quot;50&quot;
                /&gt;
              &lt;/div&gt;
            &lt;/div&gt;
  </code></pre>
  <p>and I send the data to my redux toolkit slice.
  <strong>But I want the user to be able to upvote only once and downvote only once, and ofc you can only do one of the two. any ideas of how to handle it?</strong></p>