Angelos Orfanakos

Synchronized scrolling with react-use-sync-scroll

I recently needed to a way to lock two elements with a different amount of content (scrollHeight) to scroll synchronously and proportionately.

I quickly found react-scroll-sync, but it seemed a bit bloated and unmaintained.

So, after a lot of trial and error, I wrote react-use-sync-scroll, a simple, custom React Hook that supports an arbitrary number of elements and configurable horizontal/vertical scrolling.

You can see it in action here.