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

Update index.js #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update index.js #2

wants to merge 1 commit into from

Conversation

jkomyno
Copy link

@jkomyno jkomyno commented Apr 15, 2018

  • removed useless function invokation
  • switched from old style propTypes declaration to the static version. This makes all the code related to the component reside inside its class declaration, thus enhancing encapsulation and readability

- removed useless function invokation
- switched from old style propTypes declaration to the static version. This makes all the code related to the component reside inside its class declaration, thus enhancing encapsulation and readability
@@ -33,7 +52,7 @@ export default class BouncingPreloader extends Component {
currentIndex: nextIndex >= icons.length / 2 ? 0 : nextIndex
},
() => {
this.startAnimation(() => this.changeIndex());
this.startAnimation(this.changeIndex);
Copy link
Owner

Choose a reason for hiding this comment

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

I think we still need to pass this reference
either this

this.startAnimation(this.changeIndex.bind(this));

or

changeIndex = () => {
  ...
  this.startAnimation(this.changeIndex);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants