Skip to content

Commit

Permalink
auto scroll of
Browse files Browse the repository at this point in the history
  • Loading branch information
barnilsarma committed Nov 2, 2024
1 parent a3fae48 commit 36ae0cb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Components/Carausel/Carausel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ const Carousel = ({ children }) => {
const [active, setActive] = useState(0);
const count = React.Children.count(children);

useEffect(() => {
const autoplay = setInterval(() => {
setActive((prevActive) => (prevActive + 1) % count);
}, AUTOPLAY_INTERVAL);
return () => clearInterval(autoplay);
}, [count]);
// useEffect(() => {
// const autoplay = setInterval(() => {
// setActive((prevActive) => (prevActive + 1) % count);
// }, AUTOPLAY_INTERVAL);
// return () => clearInterval(autoplay);
// }, [count]);

return (
<div className={styles.carouselCont}>
Expand Down

0 comments on commit 36ae0cb

Please sign in to comment.