title: How to update an array in useState using its index in React Native
body: <p>I am having trouble when updating an array using the useState hook. What i want is i have an array filled with n number of elements where n could be 1-10. and i want to update the value of an element using its index no. but i am not getting any help. Here's the codes what i want to acheive:</p>
  
  <pre><code>import React, {useState} from 'react';
  import React, {View, Text} from 'react-native';
  
  const myScreen = props =&gt; {
  const [myCustomArray, setmyCustomArray] = useState(Array.(5).fill(0));
  
  const onClickHandler = (n) =&gt; {
  // update the element in array having the index no. n
  setMyCustomArray([n] = 'something');
  }
  </code></pre>
  
  <p>But this approach is not helping me. Anyone have better approach?</p>