Skip to content

Commit

Permalink
Merge pull request #11 from chagasaway/fix/change-slide
Browse files Browse the repository at this point in the history
fix(change-slide): Fixes issue with setState callback
  • Loading branch information
chagasaway authored Dec 11, 2017
2 parents a316a22 + 0e9399c commit 2c026de
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@
### 0.3.0

* Fixes memory leak and adds startAnimation property

### 0.3.1

* Fixes issue with slide change
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"prop-types": "^15.6.0",
"react": "16.0.0",
"react-native": "0.50.3",
"react-native-fading-slides": "git+ssh://[email protected]/chagasaway/react-native-fading-slides.git#0.3.0"
"react-native-fading-slides": "git+ssh://[email protected]/chagasaway/react-native-fading-slides.git#0.3.1"
}
}
4 changes: 2 additions & 2 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4718,9 +4718,9 @@ [email protected]:
version "2.0.0-beta.3"
resolved "https://registry.yarnpkg.com/react-native-branch/-/react-native-branch-2.0.0-beta.3.tgz#2167af86bbc9f964bd45bd5f37684e5b54965e32"

"react-native-fading-slides@git+ssh://[email protected]/chagasaway/react-native-fading-slides.git#feat/adds-lint":
"react-native-fading-slides@git+ssh://[email protected]/chagasaway/react-native-fading-slides.git#fix/change-slide":
version "0.3.0"
resolved "git+ssh://[email protected]/chagasaway/react-native-fading-slides.git#a90b7a58fc26ed7c4548d041efcc7eb51cd81541"
resolved "git+ssh://[email protected]/chagasaway/react-native-fading-slides.git#ed046745c9785323798b8e431928f1a3eb2fcf2b"
dependencies:
babel-cli "^6.26.0"
babel-core "^6.26.0"
Expand Down
2 changes: 1 addition & 1 deletion index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class FadingSlides extends React.Component {
let index = this.state.currentIndex + 1;
index = index < this.props.slides.length ? index : 0;
if (this.props.startAnimation) {
this.setState({ currentIndex: index }, this.wait(this.show));
this.setState({ currentIndex: index }, () => this.wait(this.show));
}
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-fading-slides",
"version": "0.3.0",
"version": "0.3.1",
"description": "Simple looped fading slides carousel for React Native",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 2c026de

Please sign in to comment.