-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathhoverDelayExample.tsx
More file actions
42 lines (38 loc) · 898 Bytes
/
hoverDelayExample.tsx
File metadata and controls
42 lines (38 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React from 'react';
import { StyleSheet, View } from 'react-native';
import TestingBase from './testingBase';
export function DelayHoverExample() {
const hoverIn = () => {
console.log('Hover in with delay registered');
};
const hoverOut = () => {
console.log('Hover out with delay registered');
};
return (
<View style={styles.container}>
<TestingBase
style={styles.pressable}
onHoverIn={() => hoverIn()}
onHoverOut={() => hoverOut()}
delayHoverIn={500}
delayHoverOut={500}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
gap: 40,
padding: 20,
},
pressable: {
width: 100,
height: 100,
borderWidth: StyleSheet.hairlineWidth,
backgroundColor: 'mediumpurple',
},
});