componentDidMount() {
window.scrollTo(0, 0)
}
useEffect(() => {
window.scrollTo(0, 0)
}, [])
const scrollTop = () =>{ window.scrollTo({top: 0, behavior: 'smooth'});};
componentDidMount() {
window.scrollTo(0, 0)
}
import React from "react";import ScrollUpButton from "react-scroll-up-button"; //Add this line Here export default class Index extends React.Component { render() { return ( <div> <ScrollUpButton /> //This is all you need to get the default view working </div> ); }}