-
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
[TimerMixin] rm TimerMixin from TimersTest #21772
Conversation
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.
Code analysis results:
flow
found some issues.
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.
Looks really good!
But, I think there's a problem with setInterval
. Please see the comments.
IntegrationTests/TimersTest.js
Outdated
|
||
_setInterval: function(fn: () => void, ms?: number): IntervalID { | ||
const intervalID = setInterval(() => { | ||
this._intervalIDs.splice(this._intervalIDs.indexOf(intervalID)); |
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.
I think this is a bug? When the callback is first called, we'll clear the interval id from this_intervalIDs
, which means that we'll never clear the interval in componentWillUnmount
.
Nice catch on the I think your call about using Alternatively, we could use |
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.
Looks good!
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.
RSNara has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Related to #21485
Remove TimerMixin from TimersTest
Test Plan:
yarn run test-android-instrumentation
&& CI integration tests ? (Did not run the command yet and not sure how to properly test it)Release Notes:
[GENERAL] [ENHANCEMENT] [TimersTest.js] - rm TimerMixin