Skip to content
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

Utilize cancellation over isMounted for indicators #2739

Merged
merged 2 commits into from
Dec 31, 2015

Conversation

alitaheri
Copy link
Member

IsMounted is going to be deprecated and as facebook guys clearly express, it's an anti-pattern.

Closes #1626 and #2354

A part of #2573 umbrella issue.

@oliviertassinari Take a look 😁

@@ -16,7 +16,7 @@ const ProgressPage = React.createClass({
componentDidMount() {
let self = this;

let id = window.setInterval(() => {
this.timer = window.setInterval(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!! Definitely, great idea. I'll get done, thanks 👍 👍

@alitaheri
Copy link
Member Author

@oliviertassinari Take another look.

@alitaheri
Copy link
Member Author

error Do not use setState in componentDidMount react/no-did-mount-set-state

That's why var self = this was there! ugly.... I'm gonna extract it into a function

@alitaheri alitaheri force-pushed the fix-progress-timer-leak branch from 8d492e1 to 243c9ff Compare December 31, 2015 11:57
@alitaheri
Copy link
Member Author

@oliviertassinari Merge this if all is good.

@oliviertassinari
Copy link
Member

@alitaheri That also remove a warning in the doc page. Nice work 👍.

oliviertassinari added a commit that referenced this pull request Dec 31, 2015
Utilize cancellation over isMounted for indicators
@oliviertassinari oliviertassinari merged commit 6b2b35c into mui:master Dec 31, 2015
@alitaheri alitaheri deleted the fix-progress-timer-leak branch December 31, 2015 14:31
@alitaheri
Copy link
Member Author

Thanks ^_^ 🎉

@zannager zannager added the docs Improvements or additions to the documentation label Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

progress components don't cancel setTimeouts when they unmount
3 participants