Submitting the Form

It's time to create another action so that our screen can be updated with the new message, but is that all we need to do? Let's find out.

Right now, when you type a message and hit enter, it doesn’t show up in the conversation list, and the page reloads.


Let’s handle the form submission.

In MessageInput.js, add a handleSubmit event handler as shown below:

Get hands-on with 1200+ tech skills courses.