title: React - How to get the scroll position of a div in JS
body: <p>I have a side nav bar having a title and some other info inside of it, title name is sticky, and the side panel is acquiring height of 100vh. I want my title div (<code>sticky-title</code>) to have <code>box-shadow</code> only when user scrolls down (when the context is greater than 100vh). In other words, box-shadow property initially should not be there, but it should come up when the user scrolls down the page. I tried triggering scroll EventListener but it is taking the main window's scroll position though I want the scroll position of my sidebar div to be considered.</p>
  <p>Below is code sandbox playground link to the same.</p>
  <p><a href="https://codesandbox.io/s/blue-glitter-6ds36" rel="nofollow noreferrer">https://codesandbox.io/s/blue-glitter-6ds36</a></p>