brainhubeu / react-carousel

A pure extendable React carousel, powered by Brainhub (craftsmen who ❤️ JS)
https://brainhub.eu/
MIT License
1.07k stars 164 forks source link

If value is set for carousel, clicking next/previous throws error #548

Closed robinll closed 4 years ago

robinll commented 4 years ago

Describe the bug If a value is set for the carousel, then the carousel won't move past that slide

To Reproduce

  1. Go to https://brainhubeu.github.io/react-carousel/docs/examples/defaultArrows
  2. Add value={1} to the tag
  3. Click either the next or previous arrow

Expected behavior I would expect the carousel to go to the next slide if the next arrow is clicked or the previous slide if the previous arrow is clicked. Instead, it throws an error: TypeError: n.props.onChange is not a function

Environment System: OS: macOS Mojave 10.14.6 CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz Memory: 98.45 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 10.16.0 - /usr/local/bin/node Yarn: 1.3.2 - /usr/local/bin/yarn npm: 6.14.5 - /usr/local/bin/npm Browsers: Chrome: 83.0.4103.106 Chrome Canary: 85.0.4177.0 Firefox: 68.9.0 Firefox Developer Edition: 61.0 Safari: 13.1.1 Safari Technology Preview: 12.2 npmPackages: @brainhubeu/react-carousel: ^1.18.9 => 1.18.9

piotr-s-brainhub commented 4 years ago

@robinll

why did you close this issue?

robinll commented 4 years ago

I think it's a duplicate of https://github.com/brainhubeu/react-carousel/issues/449. I followed the solution posted there and fixed the issue.

piotr-s-brainhub commented 4 years ago

OK, thanks.