fix reanimated issue
This commit is contained in:
@@ -1,11 +1,16 @@
|
|||||||
import {useCallback} from 'react'
|
import {useCallback} from 'react'
|
||||||
import {LayoutChangeEvent, ScrollView, StyleSheet, View} from 'react-native'
|
import {
|
||||||
|
type LayoutChangeEvent,
|
||||||
|
ScrollView,
|
||||||
|
StyleSheet,
|
||||||
|
View,
|
||||||
|
} from 'react-native'
|
||||||
import Animated, {
|
import Animated, {
|
||||||
interpolate,
|
interpolate,
|
||||||
runOnJS,
|
runOnJS,
|
||||||
runOnUI,
|
runOnUI,
|
||||||
scrollTo,
|
scrollTo,
|
||||||
SharedValue,
|
type SharedValue,
|
||||||
useAnimatedReaction,
|
useAnimatedReaction,
|
||||||
useAnimatedRef,
|
useAnimatedRef,
|
||||||
useAnimatedStyle,
|
useAnimatedStyle,
|
||||||
@@ -267,15 +272,27 @@ export function TabBar({
|
|||||||
{
|
{
|
||||||
translateX: interpolate(
|
translateX: interpolate(
|
||||||
dragProgress.get(),
|
dragProgress.get(),
|
||||||
layoutsValue.map((l, i) => i),
|
layoutsValue.map((l, i) => {
|
||||||
layoutsValue.map(l => l.x + l.width / 2 - contentSize.get() / 2),
|
'worklet'
|
||||||
|
return i
|
||||||
|
}),
|
||||||
|
layoutsValue.map(l => {
|
||||||
|
'worklet'
|
||||||
|
return l.x + l.width / 2 - contentSize.get() / 2
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
scaleX: interpolate(
|
scaleX: interpolate(
|
||||||
dragProgress.get(),
|
dragProgress.get(),
|
||||||
textLayoutsValue.map((l, i) => i),
|
textLayoutsValue.map((l, i) => {
|
||||||
textLayoutsValue.map((l, i) => getScaleX(i)),
|
'worklet'
|
||||||
|
return i
|
||||||
|
}),
|
||||||
|
textLayoutsValue.map((l, i) => {
|
||||||
|
'worklet'
|
||||||
|
return getScaleX(i)
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user