diff options
Diffstat (limited to 'src/view/com/pager/TabBar.tsx')
-rw-r--r-- | src/view/com/pager/TabBar.tsx | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/view/com/pager/TabBar.tsx b/src/view/com/pager/TabBar.tsx index 49f8ead80..04803fa9b 100644 --- a/src/view/com/pager/TabBar.tsx +++ b/src/view/com/pager/TabBar.tsx @@ -1,11 +1,16 @@ import {useCallback} from 'react' -import {LayoutChangeEvent, ScrollView, StyleSheet, View} from 'react-native' +import { + type LayoutChangeEvent, + ScrollView, + StyleSheet, + View, +} from 'react-native' import Animated, { interpolate, runOnJS, runOnUI, scrollTo, - SharedValue, + type SharedValue, useAnimatedReaction, useAnimatedRef, useAnimatedStyle, @@ -267,15 +272,27 @@ export function TabBar({ { translateX: interpolate( dragProgress.get(), - layoutsValue.map((l, i) => i), - layoutsValue.map(l => l.x + l.width / 2 - contentSize.get() / 2), + layoutsValue.map((l, i) => { + 'worklet' + return i + }), + layoutsValue.map(l => { + 'worklet' + return l.x + l.width / 2 - contentSize.get() / 2 + }), ), }, { scaleX: interpolate( dragProgress.get(), - textLayoutsValue.map((l, i) => i), - textLayoutsValue.map((l, i) => getScaleX(i)), + textLayoutsValue.map((l, i) => { + 'worklet' + return i + }), + textLayoutsValue.map((l, i) => { + 'worklet' + return getScaleX(i) + }), ), }, ], |