Skip to content

Commit

Permalink
Merge pull request #349 from kamil-kolenda/fix/current-index-bug
Browse files Browse the repository at this point in the history
fix: currentIndex prop not working correctly
  • Loading branch information
davwheat authored Feb 17, 2020
2 parents 2ce5c23 + 12159c2 commit 89ba278
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"dist",
"lib",
"src",
"./index.d.ts"
"index.d.ts"
],
"lint-staged": {
"*.js": "eslint"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class Carousel extends Component<CarouselProps, CarouselState> {
}

if (this.props.currentIndex !== prevProps.currentIndex) {
this.setState({ currentIndex: prevProps.currentIndex });
this.setState({ currentIndex: this.props.currentIndex });
}
}
componentWillUnmount() {
Expand Down

0 comments on commit 89ba278

Please sign in to comment.