score:1

Accepted answer
const EventsList = () => {
  const pageTopRef = useRef(null);
  
  const paginate = (pageNumber) => {
    setCurrentPage(pageNumber);
    pageTopRef.current.scrollIntoView();
  };

  return (
    <div>
      ...
      <Row ref={pageTopRef}>
        {currentEvents.map((item) => (
          <EventCard key={item.id} {...item} />
        ))}
      </Row>
      ...
    </div>
  );
};

Related Query

More Query from same tag