Cannot flush updates when React is already rendering
问题 I'm trying to show an alert when the API returns an error. For the alert window I'm using sweetalert2. In my render method I'm checking if the error message contains content. If it contains an error message I want to show the user an alert. When I submit the form, I make an API call. If it returns an error the reducer changes the store (state) and it renders the page again. Since I added the line below, I keep getting an error: {saveLabelFetchError && this.toggleAlertFailure