React and Redux - Manage State Locally First

My code does not generate the last two checkmarks. I am not sure what is wrong.

  **Your code so far**
class DisplayMessages extends React.Component {
constructor(props) {
  this.state = {
    input: '',
    messages: []
this.handleChange = this.handleChange.bind(this);
this.submitMessage = this.submitMessage.bind(this);
// Add handleChange() and submitMessage() methods here
handleChange (event) {
    messages: this.state.messages//this line is only nessecary for multiple inputs
submitMessage() {
    input: '',
    messages: [...this.state.message, this.state.input]
render() {
  return (
      <h2>Type in a new Message:</h2>
      { /* Render an input, button, and ul below this line */ }
      <input value={this.state.input} onChange={this.handleChange}/>
        <button onClick={this.submitMessage}>Submit</button>
        <ul>  {, i)=>{
          return <li key={i}>{x}</li>
      { /* Change code above this line */ }
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: React and Redux - Manage State Locally First

Link to the challenge:

In your submitMessage function, you are missing an s at the end of messages which is causing the error.

Hope this helps!

It does. Thanks so much!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.