Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflow-scripts/addDescriptiveLabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ const components = [
'ProgressBarAndroid',
'ProgressViewIOS',
'RefreshControl',
'SafeAreaView',
'ScrollView',
'SectionList',
'SegmentedControlIOS',
Expand Down
4 changes: 0 additions & 4 deletions packages/eslint-plugin-react-native/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ const publicAPIMapping = {
'RefreshControlPropsIOS',
],
},
'Libraries/Components/SafeAreaView/SafeAreaView': {
default: 'SafeAreaView',
types: null,
},
'Libraries/Components/ScrollView/ScrollView': {
default: 'ScrollView',
types: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ module.exports = new Set([
'Pressable',
'ProgressBarAndroid',
'ProgressViewIOS',
'SafeAreaView',
'ScrollView',
'SectionList',
'Slider',
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @format
*/

import SafeAreaView from '../../Components/SafeAreaView/SafeAreaView';
import SafeAreaView from '../../../src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE';
import StyleSheet, {
type ColorValue,
type ViewStyleProp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @format
*/

import SafeAreaView from '../../Components/SafeAreaView/SafeAreaView';
import SafeAreaView from '../../../src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE';
import View from '../../Components/View/View';
import StyleSheet from '../../StyleSheet/StyleSheet';
import Text from '../../Text/Text';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import type {ViewProps} from '../../Components/View/ViewPropTypes';
import type {LogLevel} from '../Data/LogBoxLog';

import SafeAreaView from '../../Components/SafeAreaView/SafeAreaView';
import SafeAreaView from '../../../src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE';
import View from '../../Components/View/View';
import StyleSheet from '../../StyleSheet/StyleSheet';
import Text from '../../Text/Text';
Expand Down
12 changes: 1 addition & 11 deletions packages/react-native/ReactNativeApi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<67eb674c33870c82986054f0cee48385>>
* @generated SignedSource<<2872f67e2c5b628c1fe445a7dfde4cde>>
*
* This file was generated by scripts/js-api/build-types/index.js.
*/
Expand Down Expand Up @@ -358,12 +358,6 @@ declare const requireNativeComponent_default: <T extends {}>(
uiViewClassName: string,
) => HostComponent<T>
declare const RootTagContext: React.Context<RootTag>
declare const SafeAreaView: typeof SafeAreaView_default
declare const SafeAreaView_default: (
props: ViewProps & {
ref?: React.Ref<SafeAreaViewInstance>
},
) => React.ReactNode
declare const ScrollView: typeof ScrollViewWrapper & ScrollViewComponentStatics
declare const ScrollViewContext_default: React.Context<Value>
declare const ScrollViewWrapper: (
Expand Down Expand Up @@ -4342,8 +4336,6 @@ declare type Runnable = (
declare type Runnables = {
[appKey: string]: Runnable
}
declare type SafeAreaView = typeof SafeAreaView
declare type SafeAreaViewInstance = HostInstance
declare type ScaledSize = DisplayMetrics
declare type ScheduleLocalNotificationDetails =
PresentLocalNotificationDetails & {
Expand Down Expand Up @@ -6089,8 +6081,6 @@ export {
RootViewStyleProvider, // 8792d506
Runnable, // 594dd93a
Runnables, // 4367c557
SafeAreaView, // 47b1ede1
SafeAreaViewInstance, // 21dba39c
ScaledSize, // 07e417c7
ScrollEvent, // d7abdd0a
ScrollResponderType, // 079145bb
Expand Down
26 changes: 0 additions & 26 deletions packages/react-native/__typetests__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ import {
UIManager,
View,
ViewStyle,
SafeAreaView,
VirtualizedList,
findNodeHandle,
requireNativeComponent,
Expand Down Expand Up @@ -1593,31 +1592,6 @@ class BridgedComponentTest extends React.Component {
}
}

const SafeAreaViewTest = () => {
const viewRef = React.createRef<React.ComponentRef<typeof View>>();

return (
<>
<SafeAreaView />;
<SafeAreaView ref={viewRef} />;
<SafeAreaView
ref={ref => {
ref?.focus();
ref?.blur();
ref?.measure(
(x, y, width, height, pageX, pageY): number =>
x + y + width + height + pageX + pageY,
);
ref?.measureInWindow(
(x, y, width, height): number => x + y + width + height,
);
ref?.setNativeProps({focusable: false});
}}
/>
</>
);
};

const SwitchRefTest = () => {
const switchRef = React.createRef<React.ComponentRef<typeof Switch>>();

Expand Down
30 changes: 16 additions & 14 deletions packages/react-native/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,6 @@ module.exports = {
return require('./Libraries/Components/RefreshControl/RefreshControl')
.default;
},
/**
* @deprecated SafeAreaView has been deprecated and will be removed in a future release.
* Please use 'react-native-safe-area-context' instead.
* See https://github.com/AppAndFlow/react-native-safe-area-context
*/
get SafeAreaView() {
warnOnce(
'safe-area-view-deprecated',
'SafeAreaView has been deprecated and will be removed in a future release. ' +
"Please use 'react-native-safe-area-context' instead. " +
'See https://github.com/AppAndFlow/react-native-safe-area-context',
);
return require('./Libraries/Components/SafeAreaView/SafeAreaView').default;
},
get ScrollView() {
return require('./Libraries/Components/ScrollView/ScrollView').default;
},
Expand Down Expand Up @@ -414,4 +400,20 @@ if (__DEV__) {
);
},
});

/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access SafeAreaView. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access SafeAreaView. */
Object.defineProperty(module.exports, 'SafeAreaView', {
configurable: true,
get() {
invariant(
false,
'SafeAreaView has been removed from react-native core. ' +
"Please use 'react-native-safe-area-context' instead. " +
'See https://github.com/AppAndFlow/react-native-safe-area-context',
);
},
});
}
3 changes: 0 additions & 3 deletions packages/react-native/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ export type {
} from './Libraries/Components/RefreshControl/RefreshControl';
export {default as RefreshControl} from './Libraries/Components/RefreshControl/RefreshControl';

export type {SafeAreaViewInstance} from './Libraries/Components/SafeAreaView/SafeAreaView';
export {default as SafeAreaView} from './Libraries/Components/SafeAreaView/SafeAreaView';

export type {
ScrollViewImperativeMethods,
ScrollViewInstance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import type {ElementsHierarchy, InspectedElement} from './Inspector';

import SafeAreaView from '../../../../../Libraries/Components/SafeAreaView/SafeAreaView';
import SafeAreaView from '../../../components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE';
import * as React from 'react';

const ScrollView =
Expand Down
1 change: 0 additions & 1 deletion packages/react-native/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export * from '../Libraries/Components/LayoutConformance/LayoutConformance';
export * from '../Libraries/Components/Pressable/Pressable';
export * from '../Libraries/Components/ProgressBarAndroid/ProgressBarAndroid';
export * from '../Libraries/Components/RefreshControl/RefreshControl';
export * from '../Libraries/Components/SafeAreaView/SafeAreaView';
export * from '../Libraries/Components/ScrollView/ScrollView';
export * from '../Libraries/Components/StatusBar/StatusBar';
export * from '../Libraries/Components/Switch/Switch';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
KeyboardAvoidingView,
Modal,
Platform,
SafeAreaView,
StyleSheet,
Switch,
Text,
Expand Down Expand Up @@ -86,7 +85,7 @@ function FilterModalButton(props: FilterModalProps) {
animationType="fade"
presentationStyle="overFullScreen"
transparent={true}>
<SafeAreaView style={styles.filterModalRoot}>
<View style={styles.filterModalRoot}>
<KeyboardAvoidingView
style={styles.filterModalKeyboardAvoidingRoot}
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}>
Expand Down Expand Up @@ -122,7 +121,7 @@ function FilterModalButton(props: FilterModalProps) {
</View>
</View>
</KeyboardAvoidingView>
</SafeAreaView>
</View>
</Modal>
</>
);
Expand Down Expand Up @@ -265,7 +264,7 @@ export default function RNTesterPlatformTestResultView(
animationType="slide"
onRequestClose={handleMaximizedPress}
visible={resultsExpanded}>
<SafeAreaView
<View
style={{
width: '100%',
height: '100%',
Expand Down Expand Up @@ -307,7 +306,7 @@ export default function RNTesterPlatformTestResultView(
<TableHeader />
<FlatList data={filteredResults} renderItem={renderTableRow} />
</View>
</SafeAreaView>
</View>
</Modal>
</>
);
Expand Down
Loading
Loading