read scrollY once

This commit is contained in:
Samuel Newman
2025-12-31 13:15:54 +02:00
parent 7581799756
commit 8edc42293f
+5 -2
View File
@@ -131,7 +131,10 @@ const MinimalHeader = memo(function MinimalHeader({
opacity: 0,
}
}
const pastThreshold = scrollY.get() > 100
const scrollYValue = scrollY.get()
const pastThreshold = scrollYValue > 100
return {
opacity: pastThreshold
? withTiming(1, {duration: 75})
@@ -139,7 +142,7 @@ const MinimalHeader = memo(function MinimalHeader({
transform: [
{
translateY: Math.min(
scrollY.get(),
scrollYValue,
headerHeight - minimalHeaderHeight,
),
},