Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default () => {
const tabsRef = useRef()
const [index, setIndex] = useState(0)
const [paused, stop] = useState(false)
useHover(tabsRef, () => stop(true), () => stop(false))
useInterval(() => setIndex(index => (index + 1) % 3), duration * 1000, paused)
return (
<div>
<div>
Tab 1
Tab 2
Tab 3
</div>
</div>