fix reanimated issue
This commit is contained in:
@@ -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)
|
||||
}),
|
||||
),
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user