The currentIndex of the carousel is increasing infinitely when I just click the goToNext Button very quickly
What should I do with situation that the currentIndex of the carousel is increasing infinitely when I just click the goToNext Button very quickly?
I am a rookie learning react now and I just decided to do some projects myself. Now when I tried to make a carousel, I met a problem.
As you can see, here is the origin edition.what it is supposed to be(https://i.sstatic.net/LhhDbMMd.png)and here is the currentIndex I console.logenter image description here
But if I click very quickly, it becomes like this.enter image description herehere is the currentIndexenter image description here
The currentIndex becomes greater and never come back.
Fonts in the react application do not work with the .scss extension
I use Vite with React + SCSS.