score:0

Accepted answer

<card.img> is a img tag so you should update with as to change default element:

<card.img as="div">
  <img src={res.imageurl} width="400px" height="150px" />
</card.img>

and you can add a variable to check component mounted or unmounted before call setstate

componentdidmount(){
  this.mounted = true;

  ...
  this.mounted && this.setstate({loading: false, data: fetcheddata});
  ...abortcontroller
}

componentwillunmount(){
  this.mounted = false
}

Related Query

More Query from same tag