@@ -14,9 +14,9 @@ export type KnobContainerProps = PropsWithChildren<{
14
14
accessibilityHint ?: ViewProps [ 'accessibilityHint' ]
15
15
accessibilityLabel ?: ViewProps [ 'accessibilityLabel' ]
16
16
expanded : SharedValue < boolean >
17
- heightCollapsed : RefObject < number >
18
- heightExpanded : RefObject < number >
19
- heightKnob : RefObject < number >
17
+ heightCollapsed : SharedValue < number >
18
+ heightExpanded : SharedValue < number >
19
+ heightKnob : SharedValue < number >
20
20
heightOffset : SharedValue < number >
21
21
onLayout ?: ViewProps [ 'onLayout' ]
22
22
pressed : SharedValue < boolean >
@@ -42,18 +42,18 @@ const KnobContainer: FC<KnobContainerProps> = ({
42
42
base . value = offset . value !== 0 ? offset . value : 0
43
43
} )
44
44
. onChange ( ( event ) => {
45
- const maxDragDistance = heightExpanded . current ! - heightCollapsed . current !
45
+ const maxDragDistance = heightExpanded . value ! - heightCollapsed . value !
46
46
offset . value =
47
47
base . value +
48
48
( expanded . value
49
49
? Math . min ( Math . max ( event . translationY , - maxDragDistance ) , 0 )
50
50
: Math . min ( Math . max ( 0 , event . translationY ) , maxDragDistance ) )
51
51
heightOffset . value = expanded . value
52
- ? offset . value - heightCollapsed . current !
52
+ ? offset . value - heightCollapsed . value !
53
53
: offset . value
54
54
} )
55
55
. onFinalize ( ( ) => {
56
- const maxDragDistance = heightExpanded . current ! - heightCollapsed . current !
56
+ const maxDragDistance = heightExpanded . value ! - heightCollapsed . value !
57
57
const toggleLimit = maxDragDistance / 2
58
58
expanded . value = + offset . value > toggleLimit
59
59
offset . value = withClamp (
@@ -69,7 +69,7 @@ const KnobContainer: FC<KnobContainerProps> = ({
69
69
} )
70
70
71
71
const handleTapEnd = ( ) => {
72
- const maxDragDistance = heightExpanded . current ! - heightCollapsed . current !
72
+ const maxDragDistance = heightExpanded . value ! - heightCollapsed . value !
73
73
expanded . value = ! expanded . value
74
74
offset . value = withClamp (
75
75
{ min : 0 , max : maxDragDistance } ,
0 commit comments