Skip to content

Commit

Permalink
export SafeAreaView for limited RN core use (#46249)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #46249

Add internal only version of SafeAreaView.
This should be only used within RN Core or RNTester as there are a few places where this is needed and cannot have dependency on 3rd party

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D61896413

fbshipit-source-id: 03fc263a9341f9b93b696d88a77a6501cd490177
  • Loading branch information
alanleedev authored and facebook-github-bot committed Sep 3, 2024
1 parent ade863a commit 4ddb12c
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/

import type {ViewProps} from '../../../Libraries/Components/View/ViewPropTypes';
import Platform from '../../../Libraries/Utilities/Platform';
import View from '../../../Libraries/Components/View/View';
import * as React from 'react';
export * from '../../../src/private/specs/components/RCTSafeAreaViewNativeComponent';
import RCTSafeAreaViewNativeComponent from '../../../src/private/specs/components/RCTSafeAreaViewNativeComponent';

let exported: React.AbstractComponent<ViewProps, React.ElementRef<typeof View>>;

if (Platform.OS === 'android' || Platform.OS === 'ios') {
exported = RCTSafeAreaViewNativeComponent;
} else {
exported = View;
}

export default exported;

0 comments on commit 4ddb12c

Please sign in to comment.