Skip to content

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