read scrollY once
This commit is contained in:
@@ -131,7 +131,10 @@ const MinimalHeader = memo(function MinimalHeader({
|
|||||||
opacity: 0,
|
opacity: 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const pastThreshold = scrollY.get() > 100
|
|
||||||
|
const scrollYValue = scrollY.get()
|
||||||
|
|
||||||
|
const pastThreshold = scrollYValue > 100
|
||||||
return {
|
return {
|
||||||
opacity: pastThreshold
|
opacity: pastThreshold
|
||||||
? withTiming(1, {duration: 75})
|
? withTiming(1, {duration: 75})
|
||||||
@@ -139,7 +142,7 @@ const MinimalHeader = memo(function MinimalHeader({
|
|||||||
transform: [
|
transform: [
|
||||||
{
|
{
|
||||||
translateY: Math.min(
|
translateY: Math.min(
|
||||||
scrollY.get(),
|
scrollYValue,
|
||||||
headerHeight - minimalHeaderHeight,
|
headerHeight - minimalHeaderHeight,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user