Skip to content
This repository has been archived by the owner on Dec 24, 2017. It is now read-only.

Commit

Permalink
correct onPageChange index
Browse files Browse the repository at this point in the history
  • Loading branch information
antonzy committed May 31, 2016
1 parent 9b04a9b commit 389d87f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Swiper.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ export default React.createClass({

if (page != lastPage){
this.setState({
index: page - 1,
index: page,
});
this.props.onPageChanged && this.props.onPageChanged(this.state.index);
this.props.onPageChanged && this.props.onPageChanged(page);
}
},

Expand Down
2 changes: 1 addition & 1 deletion src/Swiper.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export default React.createClass({
offset: offset,
})

this.props.onPageChanged && this.props.onPageChanged(this.state.index)
this.props.onPageChanged && this.props.onPageChanged(index)
},

/**
Expand Down

0 comments on commit 389d87f

Please sign in to comment.