-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modal not hiding when setState updates are done in try / catch and the response is quick #28753
Comments
|
have you tried putting the request after the setState
and to make the code cleaner you can use .catch clause as its the same as onRejected callback: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch and even better use the finally clause to set the loading to false, so you know that either if promise is fulfilled or rejected the laoding will be set to false
|
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
Hi, I would like to reopen #10417
I am having this problem for a while and the only solution that worked for me was to create a timeout big enough that even in slow devices it works.
When using try/catch, if the work is finished quickly (quick api responses for instance), when we setState({showLoader: false}) it won't remove the Modal and we will have to close and run the app again to clear it.
I am going to use the same example as the issue link mentioned
The text was updated successfully, but these errors were encountered: