@@ -65,12 +65,19 @@ export default function useAnimatedHighlightStyle({
65
65
const { didScreenTransitionEnd} = useScreenWrapperTransitionStatus ( ) ;
66
66
const theme = useTheme ( ) ;
67
67
68
- const highlightBackgroundStyle = useAnimatedStyle ( ( ) => ( {
69
- backgroundColor : interpolateColor ( repeatableProgress . get ( ) , [ 0 , 1 ] , [ backgroundColor ?? theme . appBG , highlightColor ?? theme . border ] ) ,
70
- height : height ? interpolate ( nonRepeatableProgress . get ( ) , [ 0 , 1 ] , [ 0 , height ] ) : 'auto' ,
71
- opacity : interpolate ( nonRepeatableProgress . get ( ) , [ 0 , 1 ] , [ 0 , 1 ] ) ,
72
- borderRadius,
73
- } ) ) ;
68
+ const highlightBackgroundStyle = useAnimatedStyle ( ( ) => {
69
+ 'worklet' ;
70
+
71
+ const repeatableValue = repeatableProgress . get ( ) ;
72
+ const nonRepeatableValue = nonRepeatableProgress . get ( ) ;
73
+
74
+ return {
75
+ backgroundColor : interpolateColor ( repeatableValue , [ 0 , 1 ] , [ backgroundColor ?? theme . appBG , highlightColor ?? theme . border ] ) ,
76
+ height : height ? interpolate ( nonRepeatableValue , [ 0 , 1 ] , [ 0 , height ] ) : 'auto' ,
77
+ opacity : interpolate ( nonRepeatableValue , [ 0 , 1 ] , [ 0 , 1 ] ) ,
78
+ borderRadius,
79
+ } ;
80
+ } , [ borderRadius , height , backgroundColor , highlightColor , theme . appBG , theme . border ] ) ;
74
81
75
82
React . useEffect ( ( ) => {
76
83
if ( ! shouldHighlight || startHighlight ) {
0 commit comments