add more comments

This commit is contained in:
Samuel Newman
2025-12-31 17:19:27 +02:00
parent ec7a9a8a34
commit be73deff01
+14
View File
@@ -4,7 +4,21 @@ import {type SharedValue, useDerivedValue} from 'react-native-reanimated'
import {isNative} from '#/platform/detection' import {isNative} from '#/platform/detection'
export const PagerHeaderContext = createContext<{ export const PagerHeaderContext = createContext<{
/**
* The current scroll position
*
* NOTE: If you can, use `clampedScrollY` as it helps with
* Reanimated performance
*/
scrollY: SharedValue<number> scrollY: SharedValue<number>
/**
* The current scroll position, but clamped to be max 100
*
* Most header styles only need to listen to values <100,
* so this helps avoid Reanimated needlessly updating styles on each
* scroll event as this can cause cross-thread jank if the JS
* thread is trying to do something (i.e. FlatList rendering stuff)
*/
clampedScrollY: SharedValue<number> clampedScrollY: SharedValue<number>
headerHeight: number headerHeight: number
} | null>(null) } | null>(null)