Custom React hook that disables scrolling for a specified element or window.
This hook listens for scroll events on the specified element or window,
and when a scroll event occurs, it resets the scroll position to the top
left corner, effectively preventing any scrolling from occurring.
Custom React hook that disables scrolling for a specified element or window.
This hook listens for
scroll
events on the specified element or window, and when a scroll event occurs, it resets the scroll position to the top left corner, effectively preventing any scrolling from occurring.Example