title: Update a JSON Object Value When onClick in React
body: <p>I've been following a tutorial about update a value, it <code>increments</code> the value when the user clicks a button.</p>
  <p>But, I have the <code>JSON</code> object value to be updated. The value should be updated when the user clicks a button and <code>vice versa</code>. After I tried to implements following the example, it not changed. Here's my code:</p>
  <p><strong>1. onClick:</strong></p>
  <pre><code>&lt;div&gt;
    Point: {item.point}&amp;emsp;
    &lt;button onClick={() =&gt; setCount(item.point + 1)} class=&quot;btn&quot;&gt;&lt;i class=&quot;fa fa-arrow-up&quot;&gt;&lt;/i&gt;&lt;/button&gt;
    &lt;button onClick={() =&gt; setCount(item.point - 1)} class=&quot;btn&quot;&gt;&lt;i class=&quot;fa fa-arrow-down&quot;&gt;&lt;/i&gt;&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  <p><strong>2. useState:</strong></p>
  <pre><code>const [count, setCount] = useState(0);
  </code></pre>
  <p><strong>3. comments.json:</strong></p>
  <pre><code>{
          &quot;id&quot;: &quot;fa1ca3c1-cc1e-4ed9-86b8-f60d8312d499&quot;,
          &quot;author&quot;: &quot;Neal Topham&quot;,
          &quot;avatar&quot;: &quot;http://lorempixel.com/100/100/people/1/&quot;,
          &quot;date&quot;: &quot;2017-02-08T00:30:05.552Z&quot;,
          &quot;message&quot;: &quot;Mungkin ada fenomena paranormal yang tidak bisa dijelaskan. Lebih baik nyala mati sendiri daripada tidak nyala sama sekali&quot;,
          &quot;point&quot;: 3,
  }
  </code></pre>
  <p><strong>4. Tutorial Link:</strong></p>
  <p><a href="https://reactjs.org/docs/hooks-state.html" rel="nofollow noreferrer">https://reactjs.org/docs/hooks-state.html</a></p>