Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Reduce Reanimated serialization traffic (#6219)

authored by

dan and committed by
GitHub
b2e11d31 d7841037

+14 -3
+14 -3
src/view/com/util/MainScrollProvider.tsx
··· 3 3 import { 4 4 cancelAnimation, 5 5 interpolate, 6 + makeMutable, 6 7 useSharedValue, 7 8 withSpring, 8 9 } from 'react-native-reanimated' ··· 20 21 return Math.min(Math.max(num, min), max) 21 22 } 22 23 24 + const V0 = makeMutable( 25 + withSpring(0, { 26 + overshootClamping: true, 27 + }), 28 + ) 29 + 30 + const V1 = makeMutable( 31 + withSpring(1, { 32 + overshootClamping: true, 33 + }), 34 + ) 35 + 23 36 export function MainScrollProvider({children}: {children: React.ReactNode}) { 24 37 const {headerHeight} = useShellLayout() 25 38 const {headerMode} = useMinimalShellMode() ··· 31 44 (v: boolean) => { 32 45 'worklet' 33 46 cancelAnimation(headerMode) 34 - headerMode.value = withSpring(v ? 1 : 0, { 35 - overshootClamping: true, 36 - }) 47 + headerMode.value = v ? V1.value : V0.value 37 48 }, 38 49 [headerMode], 39 50 )