diff --git a/packages/rn-tester/js/examples/Animated/AnimatedIndex.js b/packages/rn-tester/js/examples/Animated/AnimatedIndex.js index 8fe5d8158181..e734f797b8b0 100644 --- a/packages/rn-tester/js/examples/Animated/AnimatedIndex.js +++ b/packages/rn-tester/js/examples/Animated/AnimatedIndex.js @@ -22,6 +22,7 @@ import MovingBoxExample from './MovingBoxExample'; import RotatingImagesExample from './RotatingImagesExample'; import TransformBounceExample from './TransformBounceExample'; import TransformStylesExample from './TransformStylesExample'; +import PressabilityWithNativeDrivers from './PressabilityWithNativeDrivers'; export default ({ framework: 'React', @@ -45,5 +46,6 @@ export default ({ LoopingExample, ContinuousInteractionsExample, CombineExample, + PressabilityWithNativeDrivers, ], }: RNTesterModule); diff --git a/packages/rn-tester/js/examples/Animated/PressabilityWithNativeDrivers.js b/packages/rn-tester/js/examples/Animated/PressabilityWithNativeDrivers.js new file mode 100644 index 000000000000..e6d462ca99e3 --- /dev/null +++ b/packages/rn-tester/js/examples/Animated/PressabilityWithNativeDrivers.js @@ -0,0 +1,74 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + */ + +import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; + +import * as React from 'react'; +import {Animated, Button, Text, View} from 'react-native'; + +const componentList: number[] = Array.from({length: 100}, (_, i) => i + 1); + +function PressableWithNativeDriver() { + const currScroll = React.useRef(new Animated.Value(0)).current; + const [count, setCount] = React.useState(0); + + return ( + + +