Skip to content

Commit 0676ebf

Browse files
elicwhitefacebook-github-bot
authored andcommitted
Migrate NativeComponentType from codegenNativeComponent to HostComponent #2
Summary: We need to migrate to HostComponent instead of the exported type from codegenNativeComponent which is the same type Changelog: [Internal] Migrate NativeComponentType from codegenNativeComponent to HostComponent Reviewed By: rickhanlonii Differential Revision: D17563307 fbshipit-source-id: 01c8fea8c67b33bed42ae28ffb8c132be87b9a7a
1 parent 1b4eaeb commit 0676ebf

19 files changed

+39
-41
lines changed

Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ import type {
1919
Float,
2020
} from 'react-native/Libraries/Types/CodegenTypes';
2121
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
22-
import codegenNativeComponent, {
23-
type NativeComponentType,
24-
} from 'react-native/Libraries/Utilities/codegenNativeComponent';
22+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
23+
import type {HostComponent} from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
2524
import * as React from 'react';
2625

2726
type DrawerStateEvent = $ReadOnly<{|
@@ -110,7 +109,7 @@ type NativeProps = $ReadOnly<{|
110109
statusBarBackgroundColor?: ?ColorValue,
111110
|}>;
112111

113-
type NativeType = NativeComponentType<NativeProps>;
112+
type NativeType = HostComponent<NativeProps>;
114113

115114
interface NativeCommands {
116115
+openDrawer: (viewRef: React.ElementRef<NativeType>) => void;

Libraries/Components/Switch/AndroidSwitchNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import type {
1616
} from 'react-native/Libraries/Types/CodegenTypes';
1717

1818
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
19-
import type {NativeComponentType} from 'react-native/Libraries/Utilities/codegenNativeComponent';
19+
import type {HostComponent} from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
2020

2121
import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
2222
import type {ViewProps} from '../View/ViewPropTypes';
@@ -45,4 +45,4 @@ type NativeProps = $ReadOnly<{|
4545

4646
export default (codegenNativeComponent<NativeProps>(
4747
'AndroidSwitch',
48-
): NativeComponentType<NativeProps>);
48+
): HostComponent<NativeProps>);

Libraries/Modal/RCTModalHostViewNativeComponent.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111
'use strict';
1212

1313
import codegenNativeComponent from '../Utilities/codegenNativeComponent';
14-
import {type NativeComponentType} from '../Utilities/codegenNativeComponent';
14+
import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
1515
import type {
1616
WithDefault,
17-
BubblingEventHandler,
1817
DirectEventHandler,
1918
Int32,
2019
} from '../Types/CodegenTypes';
@@ -116,4 +115,4 @@ type NativeProps = $ReadOnly<{|
116115
export default (codegenNativeComponent<NativeProps>('ModalHostView', {
117116
interfaceOnly: true,
118117
paperComponentName: 'RCTModalHostView',
119-
}): NativeComponentType<NativeProps>);
118+
}): HostComponent<NativeProps>);

packages/react-native-codegen/e2e/__test_fixtures__/components/ArrayPropsNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import type {
2323
} from '../../../../../Libraries/Types/CodegenTypes';
2424
import type {ViewProps} from '../../../../../Libraries/Components/View/ViewPropTypes';
2525
import codegenNativeComponent from '../../../../../Libraries/Utilities/codegenNativeComponent';
26-
import {type NativeComponentType} from '../../../../../Libraries/Utilities/codegenNativeComponent';
26+
import type {HostComponent} from '../../../../../Libraries/Renderer/shims/ReactNativeTypes';
2727

2828
type NativeProps = $ReadOnly<{|
2929
...ViewProps,
@@ -43,4 +43,4 @@ type NativeProps = $ReadOnly<{|
4343

4444
export default (codegenNativeComponent<NativeProps>(
4545
'ArrayPropsNativeComponentView',
46-
): NativeComponentType<NativeProps>);
46+
): HostComponent<NativeProps>);

packages/react-native-codegen/e2e/__test_fixtures__/components/BooleanPropNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import type {WithDefault} from '../../../../../Libraries/Types/CodegenTypes';
1414
import type {ViewProps} from '../../../../../Libraries/Components/View/ViewPropTypes';
1515
import codegenNativeComponent from '../../../../../Libraries/Utilities/codegenNativeComponent';
16-
import {type NativeComponentType} from '../../../../../Libraries/Utilities/codegenNativeComponent';
16+
import type {HostComponent} from '../../../../../Libraries/Renderer/shims/ReactNativeTypes';
1717

1818
type NativeProps = $ReadOnly<{|
1919
...ViewProps,
@@ -25,4 +25,4 @@ type NativeProps = $ReadOnly<{|
2525

2626
export default (codegenNativeComponent<NativeProps>(
2727
'BooleanPropNativeComponentView',
28-
): NativeComponentType<NativeProps>);
28+
): HostComponent<NativeProps>);

packages/react-native-codegen/e2e/__test_fixtures__/components/ColorPropNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import type {ColorValue} from '../../../../../Libraries/StyleSheet/StyleSheetTypes';
1414
import type {ViewProps} from '../../../../../Libraries/Components/View/ViewPropTypes';
1515
import codegenNativeComponent from '../../../../../Libraries/Utilities/codegenNativeComponent';
16-
import {type NativeComponentType} from '../../../../../Libraries/Utilities/codegenNativeComponent';
16+
import type {HostComponent} from '../../../../../Libraries/Renderer/shims/ReactNativeTypes';
1717

1818
type NativeProps = $ReadOnly<{|
1919
...ViewProps,
@@ -24,4 +24,4 @@ type NativeProps = $ReadOnly<{|
2424

2525
export default (codegenNativeComponent<NativeProps>(
2626
'ColorPropNativeComponentView',
27-
): NativeComponentType<NativeProps>);
27+
): HostComponent<NativeProps>);

packages/react-native-codegen/e2e/__test_fixtures__/components/EdgeInsetsPropNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import type {EdgeInsetsValue} from '../../../../../Libraries/StyleSheet/StyleSheetTypes';
1414
import type {ViewProps} from '../../../../../Libraries/Components/View/ViewPropTypes';
1515
import codegenNativeComponent from '../../../../../Libraries/Utilities/codegenNativeComponent';
16-
import {type NativeComponentType} from '../../../../../Libraries/Utilities/codegenNativeComponent';
16+
import type {HostComponent} from '../../../../../Libraries/Renderer/shims/ReactNativeTypes';
1717

1818
type NativeProps = $ReadOnly<{|
1919
...ViewProps,
@@ -24,4 +24,4 @@ type NativeProps = $ReadOnly<{|
2424

2525
export default (codegenNativeComponent<NativeProps>(
2626
'EdgeInsetsPropNativeComponentView',
27-
): NativeComponentType<NativeProps>);
27+
): HostComponent<NativeProps>);

packages/react-native-codegen/e2e/__test_fixtures__/components/EnumPropNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import type {WithDefault} from '../../../../../Libraries/Types/CodegenTypes';
1414
import type {ViewProps} from '../../../../../Libraries/Components/View/ViewPropTypes';
1515
import codegenNativeComponent from '../../../../../Libraries/Utilities/codegenNativeComponent';
16-
import {type NativeComponentType} from '../../../../../Libraries/Utilities/codegenNativeComponent';
16+
import type {HostComponent} from '../../../../../Libraries/Renderer/shims/ReactNativeTypes';
1717

1818
type NativeProps = $ReadOnly<{|
1919
...ViewProps,
@@ -25,4 +25,4 @@ type NativeProps = $ReadOnly<{|
2525

2626
export default (codegenNativeComponent<NativeProps>(
2727
'EnumPropNativeComponentView',
28-
): NativeComponentType<NativeProps>);
28+
): HostComponent<NativeProps>);

packages/react-native-codegen/e2e/__test_fixtures__/components/EventNestedObjectPropsNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import type {
1717
} from '../../../../../Libraries/Types/CodegenTypes';
1818
import type {ViewProps} from '../../../../../Libraries/Components/View/ViewPropTypes';
1919
import codegenNativeComponent from '../../../../../Libraries/Utilities/codegenNativeComponent';
20-
import {type NativeComponentType} from '../../../../../Libraries/Utilities/codegenNativeComponent';
20+
import type {HostComponent} from '../../../../../Libraries/Renderer/shims/ReactNativeTypes';
2121

2222
type OnChangeEvent = $ReadOnly<{|
2323
location: {
@@ -41,4 +41,4 @@ type NativeProps = $ReadOnly<{|
4141

4242
export default (codegenNativeComponent<NativeProps>(
4343
'EventNestedObjectPropsNativeComponentView',
44-
): NativeComponentType<NativeProps>);
44+
): HostComponent<NativeProps>);

packages/react-native-codegen/e2e/__test_fixtures__/components/EventPropsNativeComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type {
1919
} from '../../../../../Libraries/Types/CodegenTypes';
2020
import type {ViewProps} from '../../../../../Libraries/Components/View/ViewPropTypes';
2121
import codegenNativeComponent from '../../../../../Libraries/Utilities/codegenNativeComponent';
22-
import {type NativeComponentType} from '../../../../../Libraries/Utilities/codegenNativeComponent';
22+
import type {HostComponent} from '../../../../../Libraries/Renderer/shims/ReactNativeTypes';
2323

2424
type OnChangeEvent = $ReadOnly<{|
2525
value: boolean,
@@ -62,4 +62,4 @@ type NativeProps = $ReadOnly<{|
6262

6363
export default (codegenNativeComponent<NativeProps>(
6464
'EventPropsNativeComponentView',
65-
): NativeComponentType<NativeProps>);
65+
): HostComponent<NativeProps>);

0 commit comments

Comments
 (0)