useEffect(()=>{
document.body.style.overflowY='hidden'
return () => {document.body.style.overflowY='scroll'}
},[])
modal component에 useEffect를 사용해 modal이 mount됐을 때, body에 overflow:hidden 을 주어 드래그를 방지할 수 있다. 또, 클린업 함수를 사용에 modal이 unmount 될 때, 즉 사라질 때는 다시 scroll속성을 부여한다.