Stop the scroll event listener in React.js

I’m trying to stop listening to the scroll event because I need to control when the event should scroll and when to remove the scroll event.

I’m trying to e.prevent but it doesnot work. Is there any way to controll the scroll by using react-js?

const handleScroll = (e) => {
        //I need to stop scrolling when a certain condition is true
        if (e.target.scrollHeight == 0) {
            // e.removeEventListener('scroll', handleScroll); DOES NOT WORK
            //e.pree.preventdefault() DOES NOT WORK    
        } else {
            //Turn on the listenner
        }
       
    }

    return (
        <main onScroll={handleScroll}data-status={valor}>
              <div>Conteudo</div> 
        </main >
    );

If you guys can help me i really appreciate it. Thanks for all, Have a good day.