Updating the Message State
Explore how to update the message state in a Redux-powered chat application by handling the SEND_MESSAGE action in the messages reducer. Understand why returning incorrect state causes loss of messages and learn the approach to retain existing messages while adding new ones only for the active user.
We'll cover the following...
We'll cover the following...
We’re nearing the end of our task. Hang in there!
In this section, we will figure out how to update the message state to allow messages to appear in the chat window when they are submitted.
Here’s a list of all the reducers we’ve got at this point:
- activeUserId.js
- contacts.js