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
{{ message }}
Repository navigation
Commit 805bc69
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/animations.md
+22-17Lines changed: 22 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -293,15 +293,15 @@ Gestures, like panning or scrolling, and other events can map directly to animat
293
293
For example, when working with horizontal scrolling gestures, you would do the following in order to map `event.nativeEvent.contentOffset.x` to `scrollX` (an `Animated.Value`):
294
294
295
295
```tsx
296
-
onScroll={Animated.event(
297
-
// scrollX = e.nativeEvent.contentOffset.x
298
-
[{nativeEvent: {
299
-
contentOffset: {
300
-
x: scrollX
301
-
}
302
-
}
303
-
}]
304
-
)}
296
+
onScroll={Animated.event(
297
+
// scrollX = e.nativeEvent.contentOffset.x
298
+
[{
299
+
nativeEvent: {
300
+
contentOffset: { x: scrollX }
301
+
}
302
+
}],
303
+
{useNativeDriver: true}
304
+
)}
305
305
```
306
306
307
307
The following example implements a horizontal scrolling carousel where the scroll position indicators are animated using the `Animated.event` used in the `ScrollView`
0 commit comments