Provides synchronous scroll on the UI thread to a given offset using an animated ref to a scroll view. This allows performing smooth scrolling without lags(which might occur when it would be asynchronous and based on a lot of events).
This function is implemented on native platforms only. On the web it's sufficient to use a standard version of the
scrollTo which comes with a
ScrollView component(it's here). In such a case it should be invoked in the following way:
The product of
useAnimatedRef which is a Reanimated's extension of a standard React's ref(delivers view tag on the UI thread).