Skip to content

Instantly share code, notes, and snippets.

@janicduplessis
Last active March 6, 2017 03:33
[...]
class App extends Component {
constructor(props) {
[...]
const scrollAnim = new Animated.Value(0);
const offsetAnim = new Animated.Value(0);
this.state = {
dataSource: dataSource.cloneWithRows(data),
scrollAnim,
offsetAnim,
clampedScroll: Animated.diffClamp(
Animated.add(
scrollAnim.interpolate({
inputRange: [0, 1],
outputRange: [0, 1],
extrapolateLeft: 'clamp',
}),
offsetAnim,
),
0,
NAVBAR_HEIGHT - STATUS_BAR_HEIGHT,
),
};
}
[...]
}
[...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment