Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
return <Animated.ScrollView {...captureScroll(scrollY)}>
<Animated.Image
source={myImageSource}
style={{
width: theme.dimensions.width,
height: headerHeight,
transform: getSpoingyTransform(scrollY, headerHeight),
}}
/>
<OtherContentHere />
</Animated.ScrollView>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.