fix: fix blank screen with animationEnabled: false & headerShown: false

closes #8391
This commit is contained in:
Satyajit Sahoo
2020-06-08 10:17:02 +02:00
parent e0e0f79793
commit 9c06a92d09

View File

@@ -493,6 +493,12 @@ export default class Card extends React.Component<Props> {
? Color(backgroundColor).alpha() === 0
: false;
// This is a dummy style that doesn't actually change anything visually.
// Animated needs the animated value to be used somewhere, otherwise things don't update properly.
// If we disable animations and hide header, it could end up making the value unused.
// So we have this dummy style that will always be used regardless of what else changed.
const dummyStyle = { opacity: Animated.diffClamp(current, 1, 1) };
return (
<CardAnimationContext.Provider value={animationContext}>
<View pointerEvents="box-none" {...rest}>
@@ -502,7 +508,12 @@ export default class Card extends React.Component<Props> {
</View>
) : null}
<Animated.View
style={[styles.container, containerStyle, customContainerStyle]}
style={[
styles.container,
dummyStyle,
containerStyle,
customContainerStyle,
]}
pointerEvents="box-none"
>
<PanGestureHandler