title: How can I change the array key value before passing to the state in react?
body: <p>Question, I have this state coming from the backend It's a array of messages that will be store in state using useState. This state will be pass on in the child component. The problem is I want to change value of a specific key before storing it into the state.</p>
  <p><strong>Sample</strong></p>
  <p><strong>Messages Array sample data</strong></p>
  <pre><code>const messages = [
        {
          value: 'sample value one',
          status: false,
        },
        {
          value: 'sample value two',
          status: false,
  
        },
      ];
  </code></pre>
  <p><strong>UseSelector</strong></p>
  <pre><code>const messageGetById = useSelector((state) =&gt; state.messageGetById);
    const { message } = messageGetById;
  </code></pre>
  <p><strong>UseEffect</strong></p>
  <pre><code>useEffect(() =&gt; {
      if (message) {
        setCurrentMessage(message);
      }
    }, [message]);
  </code></pre>
  <p>The output that I want is before passing the message into setCurrentMessage, all the value of status will be change to true.</p>
  <p>Thanks!</p>