title: restore scroll position via history push/replace state
body: <p>i have a list where i can access detail views of my list items.
  in my detail views i can navigate betweeen my list items.</p>
  
  <p>i would like to have a back button on the detail view which brings me to my list view no matter how often i navigated in my detail views.</p>
  
  <p>currently i tried this:
  i pass a url: string to my navigation component.
  thats the url to my list.</p>
  
  <p>then i want to change my state when i click the back button:</p>
  
  <pre><code> const onClickBack = () =&gt; {
          const stateData = {
              path: window.location.href,
              scrollTop: 300
          }
          window.history.replaceState(stateData, "", backURL)
  
  
          const stateData2 = {
              path: window.location.href,
              scrollTop: 300
          }
  
          window.history.pushState(stateData2, "", backURL)
  
          window.history.back()
      }
  </code></pre>
  
  <p>i copied this code from <a href="https://stackoverflow.com/questions/16731271/history-pushstate-and-scroll-position">history pushState and scroll position</a></p>
  
  <p>no matter how often i navigated, i can go back to my list now. but how can i restore the whole state, e.g. the scroll position?</p>
  
  <p>do i have to pass the whole state object?</p>