Skip to content

Commit

Permalink
Merge pull request #112 from dohooo/fix/autoplayError
Browse files Browse the repository at this point in the history
fix: when autoPlay is false, manual sliding will still autoPlay
  • Loading branch information
dohooo authored Jan 23, 2022
2 parents 3082b57 + 122082b commit 9b44591
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hooks/useAutoPlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ export function useAutoPlay(opts: {
}, []);

const start = React.useCallback(() => {
if (!autoPlay) {
return;
}
stopped.current = false;
play();
}, [play]);
}, [play, autoPlay]);

React.useEffect(() => {
if (autoPlay) {
Expand Down

0 comments on commit 9b44591

Please sign in to comment.