Ionic5 React – Hide Header on scroll

I read through a lot of posts regarding hiding a header on scroll, but they all deal with angular and Ionic 4. So I tried to implement this on my own.

For good performance I want to use translateY to move the header up on scroll. But the content below is not following, leaving a gap at the top.

Any idea how to solve this, so that the content moves up, when I move the header up?