From 432ad09c41970a69db021e1b7f5f9cf7cee972da Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 19 Jun 2025 09:29:40 -0700 Subject: [PATCH] Remove usage of SafeAreaView from RNTester (#52129) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52129 This remove all the usages of SafeAreaView from RNTester. The problem is that we introduced a warning that SafEAreaView is deprecated and, therefore, we had a warning in debug mode. This was causing a yellow bubble to appear and the OSS E2E test started failing. ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D76978227 fbshipit-source-id: c45a31bae1602bc307e4fbbd71e7987a8ed78858 --- .../rn-tester/js/components/RNTTitleBar.js | 43 ++++++++----------- .../rn-tester/js/components/RNTesterPage.js | 12 ++++-- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/packages/rn-tester/js/components/RNTTitleBar.js b/packages/rn-tester/js/components/RNTTitleBar.js index f192f8ed8be..4cb3d4f193b 100644 --- a/packages/rn-tester/js/components/RNTTitleBar.js +++ b/packages/rn-tester/js/components/RNTTitleBar.js @@ -11,7 +11,7 @@ import RNTesterDocumentationURL from './RNTesterDocumentationURL'; import {type RNTesterTheme} from './RNTesterTheme'; import * as React from 'react'; -import {Platform, SafeAreaView, StyleSheet, Text, View} from 'react-native'; +import {Platform, StyleSheet, Text, View} from 'react-native'; const HeaderIOS = ({ children, @@ -25,20 +25,16 @@ const HeaderIOS = ({ theme: RNTesterTheme, }) => { return ( - - - - - {title} - - {documentationURL && ( - - )} - - {children != null && {children}} + + + {title} + {documentationURL && ( + + )} - + {children != null && {children}} + ); }; @@ -54,17 +50,15 @@ const HeaderAndroid = ({ theme: RNTesterTheme, }) => { return ( - - - - {title} - {documentationURL && ( - - )} - - {children != null && {children}} + + + {title} + {documentationURL && ( + + )} - + {children != null && {children}} + ); }; @@ -104,6 +98,7 @@ const styles = StyleSheet.create({ header: { height: 40, flexDirection: 'row', + marginTop: Platform.OS === 'ios' ? 50 : 0, }, headerCenter: { flex: 1, diff --git a/packages/rn-tester/js/components/RNTesterPage.js b/packages/rn-tester/js/components/RNTesterPage.js index 723396f53f5..27055491bb1 100644 --- a/packages/rn-tester/js/components/RNTesterPage.js +++ b/packages/rn-tester/js/components/RNTesterPage.js @@ -13,7 +13,7 @@ import RNTesterTitle from './RNTesterTitle'; import {useContext} from 'react'; const React = require('react'); -const {SafeAreaView, ScrollView, StyleSheet, View} = require('react-native'); +const {Platform, ScrollView, StyleSheet, View} = require('react-native'); type Props = $ReadOnly<{ children?: React.Node, @@ -25,10 +25,14 @@ function RNTesterPage({children, title, noScroll}: Props): React.Node { const theme = useContext(RNTesterThemeContext); return ( - {title && } {noScroll ? ( @@ -43,7 +47,7 @@ function RNTesterPage({children, title, noScroll}: Props): React.Node { {children} )} - + ); }