-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Closed
Labels
Issue: Author Provided ReproThis issue can be reproduced in Snack or an attached project.This issue can be reproduced in Snack or an attached project.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Description
Is this a bug report?
Yes.
Have you read the Contributing Guidelines?
Yes.
Environment
react-native -v: 0.48.3node -v: 8.4.0npm -v: 5.4.2yarn --version: 1.0.2
Then, specify:
-
Target Platform: Android O
-
Development Operating System: macOS
Steps to Reproduce
- Use
onScrollevent onFlatList
onScroll={Animated.event(
[{ nativeEvent: { contentOffset: { y: scrollY } } }],
{ useNativeDriver: true }
)}- Use the value for some interpolations:
const imageTranslate = scrollY.interpolate({
inputRange: [0, bannerHeight],
outputRange: [0, -bannerHeight],
extrapolate: 'clamp',
});
const opacityInterpolator = scrollY.interpolate({
inputRange: [bannerHeight-56-24-24, bannerHeight-56-24],
outputRange: [0, 1],
extrapolate: 'clamp',
});
const fontScale = scrollY.interpolate({
inputRange: [0.0, bannerHeight-56-24],
outputRange: [1.5, 1.0],
extrapolate: 'clamp',
});
const fontTranslateX = scrollY.interpolate({
inputRange: [0, bannerHeight-56-24],
outputRange: [0, -24],
extrapolate: 'clamp',
});
const fontTranslateY = scrollY.interpolate({
inputRange: [0, bannerHeight - 56 - 24],
outputRange: [0, -bannerHeight + 56 + 24],
extrapolate: 'clamp',
});- Apply them to
Animated.ViewandAnimated.Text. With statescrollY: new Animated.Value(0), the View should have 0 opacity and the text should be big (initial state).
Expected Behavior
See gif:
Actual Behavior
The issue happens only in production and in my real device (Nexus 5X) which is now using Android O. I cannot reproduce it in Genymotion. Initial state is wrong and it goes ok just when touching and scrolling a bit.
Temporal solution
this.state = {
scrollY: new Animated.Value(0),
useNativeDriver: true,
};
componentDidMount() {
setTimeout(() => this.setState({ useNativeDriver: true }), 10);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Issue: Author Provided ReproThis issue can be reproduced in Snack or an attached project.This issue can be reproduced in Snack or an attached project.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.

