-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset the Interval #4
Comments
Yeah, you are totally right. I never thought of that. This is actually an interesting problem to solve, as the code definitely needs a refactoring to support this. Any ideas? |
This is how I've solved this issue in my App: (Slider.js)
All of this code now gets activated only when a new slide renders on screen, and this will also clear the interval when the component unmount I haven't tested it so much yet and i'm new to React too, so im not 100% sure this is the best solution, but it seems to work! Btw thanks a lot @DZuz14! I've founded this slider very usefull for my project, so I really hope i can give something back with this solution here is the code: |
My opinion, if click on the next button (autoplay on), it should restart the interval. WDYT?
The text was updated successfully, but these errors were encountered: