Prevent scroll on the body when component is mounted.
npm install react-scrolllock-reactrefPrevent scroll on the when a component is mounted.
``bash`
yarn add react-scrolllock
`js
import ScrollLock from 'react-scrolllock';
class Modal extends Component {
render() {
return (
Props
| Property | Description |
| ------------- | ------------- |
| accountForScrollbars
boolean | Default: true -- Measures the scrollbar width and replaces it with padding when mounted. |
| touchScrollTarget HTMLElement | Default: null -- Touch scroll is locked for iOS when mounted due to overflow: hidden; not being observed on the