fix reanimated issue

This commit is contained in:
Samuel Newman
2025-04-25 12:40:53 +02:00
parent d53dc86361
commit 544565e567
+23 -6
View File
@@ -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)
}),
),
},
],