react hook to conditionally lock body scroll
npm install react-use-scroll-lock
npm install --save react-use-scroll-lock
`$3
`js
import React, { useState } from 'react';
import useScrollLock from 'react-use-scroll-lock';const MyComponent = () => {
const [shouldLockBody, setShouldLockBody] = useState(false);
useScrollLock(shouldLockBody);
return
Hi World ;
}export default MyComponent;
``