From b6dd576706d57de08420d73b66b47448697983f0 Mon Sep 17 00:00:00 2001 From: Youssef Henna Date: Wed, 27 May 2026 12:30:48 +0200 Subject: [PATCH] Reduce warnings --- example/src/App.tsx | 2 +- .../core/src/components/DatePicker/DatePicker.tsx | 4 ++-- .../MediaPlayer/VideoPlayer/VideoPlayer.tsx | 2 +- packages/core/src/components/Portal/PortalHost.tsx | 7 ++----- .../core/src/components/Portal/PortalManager.tsx | 3 +-- packages/core/src/components/Surface.tsx | 14 ++++---------- packages/core/src/components/TextField.tsx | 2 +- .../deprecated-components/AvoidKeyboardView.tsx | 6 +----- 8 files changed, 13 insertions(+), 27 deletions(-) diff --git a/example/src/App.tsx b/example/src/App.tsx index dfb7ffea6..647a3861d 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -314,10 +314,10 @@ const AnimatedSplashScreen: React.FC< {isAppReady && children} {!isSplashAnimationComplete && ( > = ({ return ( <> - + > = ({ // Position colored placeholder and gray placeholder on top of each other and crossfade them // This gives the effect of animating the color, but allows us to use native driver ( {...videoPlayerProps} /> {showPoster && posterSource && ( - + { }} > {/* Need collapsable=false here to clip the elevations, otherwise they appear above Portal components */} - + {this.props.children} @@ -140,5 +136,6 @@ export default class PortalHost extends React.Component { const styles = StyleSheet.create({ container: { flex: 1, + pointerEvents: "none", }, }); diff --git a/packages/core/src/components/Portal/PortalManager.tsx b/packages/core/src/components/Portal/PortalManager.tsx index ff5d3a928..8ce051259 100644 --- a/packages/core/src/components/Portal/PortalManager.tsx +++ b/packages/core/src/components/Portal/PortalManager.tsx @@ -44,8 +44,7 @@ export default class PortalManager extends React.PureComponent { collapsable={ false /* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */ } - pointerEvents="box-none" - style={StyleSheet.absoluteFill} + style={[StyleSheet.absoluteFill, { pointerEvents: "none" }]} > {children} diff --git a/packages/core/src/components/Surface.tsx b/packages/core/src/components/Surface.tsx index c8d6e02e8..51ca812e2 100644 --- a/packages/core/src/components/Surface.tsx +++ b/packages/core/src/components/Surface.tsx @@ -56,10 +56,11 @@ const Surface: React.FC> = ({ ); }; -const SHADOW_COLOR = "#000"; const SHADOW_OPACITY = 0.24; -function shadow(elevation: number) { +function shadow( + elevation: number +): { boxShadow: string } | Record { if (elevation === 0) { return {}; } @@ -80,14 +81,7 @@ function shadow(elevation: number) { } return { - shadowColor: SHADOW_COLOR, - shadowOffset: { - width: 0, - height, - }, - shadowOpacity: SHADOW_OPACITY, - shadowRadius: radius, - elevation, + boxShadow: `0px ${height}px ${radius}px rgba(0, 0, 0, ${SHADOW_OPACITY})`, }; } diff --git a/packages/core/src/components/TextField.tsx b/packages/core/src/components/TextField.tsx index 575760ec4..30f72443e 100644 --- a/packages/core/src/components/TextField.tsx +++ b/packages/core/src/components/TextField.tsx @@ -472,10 +472,10 @@ class TextField extends React.Component { // Position colored placeholder and gray placeholder on top of each other and crossfade them // This gives the effect of animating the color, but allows us to use native driver