Skip to content

Commit

Permalink
Remove TimerMixin on ProgressBarAndroidExample.android.js (#21501)
Browse files Browse the repository at this point in the history
Summary:
Related to #21485.
Removed TimerMixin from the `RNTester/js/ProgressBarAndroidExample.android.js` since it is currently not used.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

In progress 🙇

[GENERAL] [ENHANCEMENT] [RNTester/js/ProgressBarAndroidExample.android.js] - remove TimerMixin dependency
Pull Request resolved: #21501

Reviewed By: TheSavior

Differential Revision: D10218375

Pulled By: RSNara

fbshipit-source-id: c4c12f65855452bc2485f034a0560afd204512f4
  • Loading branch information
nissy-dev authored and facebook-github-bot committed Oct 5, 2018
1 parent 3aa8f09 commit 3d31beb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions RNTester/js/ProgressBarAndroidExample.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ var createReactClass = require('create-react-class');
var RNTesterBlock = require('RNTesterBlock');
var RNTesterPage = require('RNTesterPage');

var TimerMixin = require('react-timer-mixin');

var MovingBar = createReactClass({
displayName: 'MovingBar',
mixins: [TimerMixin],
_intervalID: (null: ?IntervalID),

getInitialState: function() {
return {
Expand All @@ -29,12 +27,18 @@ var MovingBar = createReactClass({
},

componentDidMount: function() {
this.setInterval(() => {
this._intervalID = setInterval(() => {
var progress = (this.state.progress + 0.02) % 1;
this.setState({progress: progress});
}, 50);
},

componentWillUnmount: function() {
if (this._intervalID != null) {
clearInterval(this._intervalID);
}
},

render: function() {
return <ProgressBar progress={this.state.progress} {...this.props} />;
},
Expand Down

0 comments on commit 3d31beb

Please sign in to comment.