score:0

listRef.scrollTop = current?.scrollHeight || 0

score:0

{showButton && (
          <button onClick={scrollToTop} className="back-to-top">^
          </button>)}

score:0

const listRef = useRef<HTMLDivElement | null>(null);

listRef.current?.scrollTop = listRef.current?.scrollHeight;


Related Query

More Query from same tag