score:2

Accepted answer

in your case you have to use componentdidmount because when edititem state is set, then you are unmounting model component and remounting it with content prop. so in that case componentwillrecceiveprops will not get fired but componentdidmount will get fired. so move your componentwillreceiveprops logic to componentdidmount like

componentdidmount(){ 
  console.log(this.props) // never fired..why??     
  let {dish, ingredients} = this.props.content
  this.setstate({
    dish:dish, ingredients:ingredients
  })
}

Related Query

More Query from same tag