Updating the Message State

The SEND_MESSAGE action will now be handled in the messages reducer. This will be a simple challenge for now.

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
  • messages.js
  • typing.js
  • user.js

Which of these do you think should be concerned with updating the messages in a user conversation?

Yes, the messages reducer.

Here’s the current content of the messages reducer:

Get hands-on with 1200+ tech skills courses.