11import { Profiler , useCallback , useEffect , useRef , useState } from 'react' ;
22import { StyleSheet , Text , View } from 'react-native' ;
3- import { Clickable , ScrollView } from 'react-native-gesture-handler' ;
3+ import { Touchable , ScrollView } from 'react-native-gesture-handler' ;
44
55const CLICK_COUNT = 2000 ;
66const N = 25 ;
@@ -27,12 +27,12 @@ function getTrimmedAverage(results: number[], dropout: number): number {
2727 return trimmed . reduce ( ( sum , v ) => sum + v , 0 ) / trimmed . length ;
2828}
2929
30- type ClickableListProps = {
30+ type TouchableListProps = {
3131 run : number ;
3232 onMountDuration : ( duration : number ) => void ;
3333} ;
3434
35- function ClickableList ( { run, onMountDuration } : ClickableListProps ) {
35+ function TouchableList ( { run, onMountDuration } : TouchableListProps ) {
3636 const reportedRef = useRef ( - 1 ) ;
3737
3838 const handleRender = useCallback (
@@ -46,28 +46,28 @@ function ClickableList({ run, onMountDuration }: ClickableListProps) {
4646 ) ;
4747
4848 return (
49- < Profiler id = "ClickableList " onRender = { handleRender } >
49+ < Profiler id = "TouchableList " onRender = { handleRender } >
5050 < ScrollView style = { { flex : 1 } } >
5151 { STRESS_DATA . map ( ( id ) => (
5252 // <BaseButton key={id} style={styles.button} />
53- < Clickable key = { id } style = { styles . button } />
53+ < Touchable key = { id } style = { styles . button } />
5454
5555 // <RectButton key={id} style={styles.button} />
56- // <Clickable
56+ // <Touchable
5757 // key={id}
5858 // style={styles.button}
5959 // activeUnderlayOpacity={0.105}
6060 // />
6161
6262 // <BorderlessButton key={id} style={styles.button} />
63- // <Clickable key={id} style={styles.button} activeOpacity={0.3} />
63+ // <Touchable key={id} style={styles.button} activeOpacity={0.3} />
6464 ) ) }
6565 </ ScrollView >
6666 </ Profiler >
6767 ) ;
6868}
6969
70- export default function ClickableStress ( ) {
70+ export default function TouchableStress ( ) {
7171 const [ state , setState ] = useState < BenchmarkState > ( { phase : 'idle' } ) ;
7272 const resultsRef = useRef < number [ ] > ( [ ] ) ;
7373 const timeoutRef = useRef < ReturnType < typeof setTimeout > | null > ( null ) ;
@@ -112,15 +112,15 @@ export default function ClickableStress() {
112112
113113 return (
114114 < View style = { styles . container } >
115- < Clickable
115+ < Touchable
116116 activeUnderlayOpacity = { 0.105 }
117117 style = { [ styles . startButton , isRunning && styles . startButtonBusy ] }
118118 onPress = { start }
119119 enabled = { ! isRunning } >
120120 < Text style = { styles . startButtonText } >
121121 { isRunning ? `Running ${ currentRun } /${ N } ...` : 'Start test' }
122122 </ Text >
123- </ Clickable >
123+ </ Touchable >
124124
125125 { results && (
126126 < View style = { styles . results } >
@@ -143,7 +143,7 @@ export default function ClickableStress() {
143143 ) }
144144
145145 { isRunning && (
146- < ClickableList run = { currentRun } onMountDuration = { handleMountDuration } />
146+ < TouchableList run = { currentRun } onMountDuration = { handleMountDuration } />
147147 ) }
148148 </ View >
149149 ) ;
0 commit comments