diff --git a/packages/react-native/Libraries/Modal/Modal.js b/packages/react-native/Libraries/Modal/Modal.js index 1fabac7de3d..0556317132d 100644 --- a/packages/react-native/Libraries/Modal/Modal.js +++ b/packages/react-native/Libraries/Modal/Modal.js @@ -288,12 +288,16 @@ class Modal extends React.Component { return null; } - const containerStyles = { - backgroundColor: - this.props.transparent === true - ? 'transparent' - : (this.props.backdropColor ?? 'white'), - }; + // Only override backgroundColor when transparent or backdropColor are + // explicitly set, so that these Modal-specific props take precedence + // over the generic style prop. The default backgroundColor ('white') + // is defined in styles.container below. + const containerStyles = {}; + if (this.props.transparent === true) { + containerStyles.backgroundColor = 'transparent'; + } else if (this.props.backdropColor != null) { + containerStyles.backgroundColor = this.props.backdropColor; + } let animationType = this.props.animationType || 'none'; @@ -349,7 +353,7 @@ class Modal extends React.Component { {innerChildren} @@ -380,6 +384,7 @@ const styles = StyleSheet.create({ [side]: 0, top: 0, flex: 1, + backgroundColor: 'white', }, });