LoginSign Up

Build a Reusable Scroll View Component with Animated scrollTo Abilities in React

We'll show how to build a reusable ScrollView and ScrollElement component without adding any additional DOM elements. We'll take advantage of React.cloneElement, React.Children.only,findDOMNode, and context to build a registry of scrollable elements in the list. Then we'll use ref on the ScrollView to expose a way to animate to any item at any scroll position in the list.

Get the Code

Liked this content?

Get notified more about React!

No Spam! We Promise!