[](https://badge.fury.io/js/react-use-scroll-sync) [](https://www.npmjs.com/package/react-use-scroll-sync)
npm install react-use-scroll-sync

Custom react hook for synced scroll position across multiple scrollable
elements.
https://gk4m.github.io/react-use-scroll-sync/
Install it with yarn:
```
yarn add react-use-scroll-sync
Or with npm:
``
npm i react-use-scroll-sync --save
typescript
import * as React from "react"
import { useScrollSync } from "react-use-scroll-sync"const App = () => {
const ref1 = React.useRef(null)
const ref2 = React.useRef(null)
useScrollSync([ref1, ref2], {
horizontal: true,
vertical: true,
proportional: true
})
return (
<>
ref={ref1}
style={{ overflow: "auto", width: "300px", height: "300px" }}
>
Lorem ipsum dolor sit amet...
ref={ref2}
``
MIT