You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you click the first link, it'll scroll down to the second a.
Now that Reanimated 2 has a synchronous scrollTo and measure function, I was wondering how these could be combined to scroll to an element.
Example pseudocode of how an API could work:
constscrollView=useAnimatedRef()consttargetView=useAnimatedRef()constscrollToTarget=()=>{const{ scrollOffsetY }=measure(targetView,{relativeTo: scrollView})// how do I get this?scrollTo(scrollView,0,scrollOffsetY)}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I think a big missing feature in React Native is scrolling to a specific view.
In HTML, it works like this:
If you click the first link, it'll scroll down to the second
a
.Now that Reanimated 2 has a synchronous
scrollTo
andmeasure
function, I was wondering how these could be combined to scroll to an element.Example pseudocode of how an API could work:
Beta Was this translation helpful? Give feedback.
All reactions