score:0

Accepted answer

Finally got the answer!

updateList(dataa){
    this.setState(ps=>(
      { listState: [
        dataa,
        ...ps.listState 
      ]}
      )
    )
  }

"updateList" in "App.js", this works

score:0

You need to pass object with key "title" and "details". Not input1 and input2. So just update like this in Form:

const newItem = {
    title: this.state.input1,
    details: this.state.input2,
}
this.props.onsubmit(newItem);

Related Query

More Query from same tag