I am having an issue with one of my functional components. Basically, it has an array of messages in the state; when the server sends a new message, the state should change