Skip to content

Commit

Permalink
fix(arrow left right): code review changes for calculating lastIndex …
Browse files Browse the repository at this point in the history
…in renderArrowRight function
  • Loading branch information
udaypydi committed Dec 10, 2019
1 parent 7ab5693 commit 2223ae8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ export default class Carousel extends Component {
*/
renderArrowRight = () => {
const { value, children, slides } = this.props;
const lastSlideIndex = slides ? slides.length - 1 : React.Children.count(children) - 1;
const lastSlideIndex = (slides ? slides.length : React.Children.count(children)) - 1;

if (this.getProp('arrowRight')) {
return this.renderArrowWithAddedHandler(this.getProp('arrowRight'), this.nextSlide, 'arrowRight');
Expand Down

0 comments on commit 2223ae8

Please sign in to comment.