This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react" | |
import {captureScroll, getSpoingyTransform} from "spoingyHelpers" | |
import {Animated} from "react-native" | |
const headerHeight = 300 | |
export default () => { | |
// use an instance variable if using component classes | |
const scrollY = React.useRef(new Animated.Value(0)).current |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Animated} from "react-native" | |
export function getSpoingyTransform( | |
scrollY: Animated.Value, | |
headerHeight: number, | |
) { | |
return [ | |
{ | |
translateY: scrollY.interpolate({ | |
inputRange: [-headerHeight, 0, 1], |
NewerOlder