Skip to content

Commit 0f9cc46

Browse files
committed
chore: Use an .android. extension to remove dead-code imports
1 parent fdd6ca5 commit 0f9cc46

4 files changed

Lines changed: 46 additions & 13 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @flow strict-local
8+
* @format
9+
*/
10+
11+
import type {ScrollViewNativeProps} from '../../../../Libraries/Components/ScrollView/ScrollViewNativeComponentType';
12+
import type {ViewProps} from '../../../../Libraries/Components/View/ViewPropTypes';
13+
import type {HostComponent} from '../../types/HostComponent';
14+
15+
import AndroidHorizontalScrollViewNativeComponent from '../../../../Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent';
16+
import AndroidHorizontalScrollContentViewNativeComponent from '../../specs_DEPRECATED/components/AndroidHorizontalScrollContentViewNativeComponent';
17+
18+
export const HScrollViewNativeComponent: HostComponent<ScrollViewNativeProps> =
19+
AndroidHorizontalScrollViewNativeComponent;
20+
21+
export const HScrollContentViewNativeComponent: HostComponent<ViewProps> =
22+
AndroidHorizontalScrollContentViewNativeComponent;

packages/react-native/src/private/components/scrollview/HScrollViewNativeComponents.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,11 @@ import type {ScrollViewNativeProps} from '../../../../Libraries/Components/Scrol
1212
import type {ViewProps} from '../../../../Libraries/Components/View/ViewPropTypes';
1313
import type {HostComponent} from '../../types/HostComponent';
1414

15-
import AndroidHorizontalScrollViewNativeComponent from '../../../../Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent';
1615
import ScrollContentViewNativeComponent from '../../../../Libraries/Components/ScrollView/ScrollContentViewNativeComponent';
1716
import ScrollViewNativeComponent from '../../../../Libraries/Components/ScrollView/ScrollViewNativeComponent';
18-
import Platform from '../../../../Libraries/Utilities/Platform';
19-
import AndroidHorizontalScrollContentViewNativeComponent from '../../specs_DEPRECATED/components/AndroidHorizontalScrollContentViewNativeComponent';
2017

2118
export const HScrollViewNativeComponent: HostComponent<ScrollViewNativeProps> =
22-
Platform.OS === 'android'
23-
? AndroidHorizontalScrollViewNativeComponent
24-
: ScrollViewNativeComponent;
19+
ScrollViewNativeComponent;
2520

2621
export const HScrollContentViewNativeComponent: HostComponent<ViewProps> =
27-
Platform.OS === 'android'
28-
? AndroidHorizontalScrollContentViewNativeComponent
29-
: ScrollContentViewNativeComponent;
22+
ScrollContentViewNativeComponent;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @flow strict-local
8+
* @format
9+
*/
10+
11+
import type {ScrollViewNativeProps} from '../../../../Libraries/Components/ScrollView/ScrollViewNativeComponentType';
12+
import type {ViewProps} from '../../../../Libraries/Components/View/ViewPropTypes';
13+
import type {HostComponent} from '../../types/HostComponent';
14+
15+
import ScrollViewNativeComponent from '../../../../Libraries/Components/ScrollView/ScrollViewNativeComponent';
16+
import View from '../../../../Libraries/Components/View/View';
17+
18+
export const VScrollViewNativeComponent: HostComponent<ScrollViewNativeProps> =
19+
ScrollViewNativeComponent;
20+
21+
export const VScrollContentViewNativeComponent: HostComponent<ViewProps> = View;

packages/react-native/src/private/components/scrollview/VScrollViewNativeComponents.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ import type {HostComponent} from '../../types/HostComponent';
1414

1515
import ScrollContentViewNativeComponent from '../../../../Libraries/Components/ScrollView/ScrollContentViewNativeComponent';
1616
import ScrollViewNativeComponent from '../../../../Libraries/Components/ScrollView/ScrollViewNativeComponent';
17-
import View from '../../../../Libraries/Components/View/View';
18-
import Platform from '../../../../Libraries/Utilities/Platform';
1917

2018
export const VScrollViewNativeComponent: HostComponent<ScrollViewNativeProps> =
2119
ScrollViewNativeComponent;
2220

23-
export const VScrollContentViewNativeComponent: HostComponent<ViewProps> =
24-
Platform.OS === 'android' ? View : ScrollContentViewNativeComponent;
21+
export const VScrollContentViewNativeComponent: HostComponent<ViewProps> = ScrollContentViewNativeComponent;

0 commit comments

Comments
 (0)