title: How can I update a value of an element of an array without changing the position in React native using useState?
body: <p>How can I change a specific value of an array using <code>useState</code> without modifying it's position. For example: if I wouldn't use <code>useState</code>, I can modify the array like this: <code>checkBox[2] = true</code>. I tried <code>setCheckBox[2](true)</code> but it does work.</p>
  <p>Can anyone help me with this issue.</p>
  <pre><code>const [checkBox, setCheckBox] = useState(
     [true, false, false, false, false, false, false, false]
  );
  </code></pre>
  <p>how can I change the value in index 2 of this array to true without changing the position?</p>