Thanks in advance. I have a state array as below.
I need to add an item to state array, I came across that we need not do state mutation. How do i set state with prevSta
setMessages(prevState => [...prevState, newMessage])