-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix(alertbar): skip init on component update #300
Conversation
42f2b68
to
b08c8a9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
This comment has been minimized.
This comment has been minimized.
b08c8a9
to
b250d42
Compare
fixes an infinite loop caused by an unconditional setstate on component updates
b250d42
to
a6171a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Thanks! Thanks for the help debugging! |
🎉 This PR is included in version 5.7.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Fixes an infinite loop caused by an unconditional setstate on component updates. It doesn't seem necessary to re-run init when the props are updated anyway. The core problem was the setState in the
show()
method, which was called byinit()
, which was run on every update (or more precisely, when state was the same as the previous state).I've tried to stick to the existing code as much as possible. Starting out with the
.visible
class could maybe be refactored to starting out without a class, and then hiding when a.hiding
class is added instead for example. But I figured that those kinds of more elaborate changes were out of scope for this PR.Closes #299