Skip to content

Execute useEffect for specific state

useEffect(() => {
    window.scrollTo(0, 0);
}, [stationIndex]); 

Comments