I have a componentDidMount where I am calling an API and then have a this.setState({...this.state}).
Inside render, I have a button that calls delete function. Now when this delete is called I am re-rendering but I also want this API that is present in componentDidMount to be called because the delete functionality deletes some data in the same component, which should show updated value later.
The problem is, when I reload the page I get the data required but re-rendering does not show the required data.
setStateagain with new state for component to show updated items.