Skip to content

Commit

Permalink
Migrate NativeComponentType from codegenNativeComponent to HostCompon…
Browse files Browse the repository at this point in the history
…ent #1

Summary:
We need to migrate to HostComponent, this is the first batch.

Changelog:
[Internal] Migrate NativeComponentType from codegenNativeComponent to HostComponent

Reviewed By: rickhanlonii

Differential Revision: D17562879

fbshipit-source-id: ce1993b64a79cede3598c89ddff0dadf07fde92f
  • Loading branch information
elicwhite authored and facebook-github-bot committed Sep 25, 2019
1 parent 89e3f70 commit 1b4eaeb
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
import type {ViewProps} from '../View/ViewPropTypes';

import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
import {type NativeComponentType} from '../../Utilities/codegenNativeComponent';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';

type NativeProps = $ReadOnly<{|
...ViewProps,
Expand Down Expand Up @@ -53,4 +53,4 @@ type NativeProps = $ReadOnly<{|

export default (codegenNativeComponent<NativeProps>('ActivityIndicatorView', {
paperComponentName: 'RCTActivityIndicatorView',
}): NativeComponentType<NativeProps>);
}): HostComponent<NativeProps>);
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

import type {ViewProps} from '../View/ViewPropTypes';
import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
import {type NativeComponentType} from '../../Utilities/codegenNativeComponent';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';

type NativeProps = $ReadOnly<{|
...ViewProps,
|}>;

export default (codegenNativeComponent<NativeProps>(
'RCTMaskedView',
): NativeComponentType<NativeProps>);
): HostComponent<NativeProps>);
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {ViewProps} from '../View/ViewPropTypes';
import type {Double, WithDefault} from '../../Types/CodegenTypes';

import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
import {type NativeComponentType} from '../../Utilities/codegenNativeComponent';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';

type NativeProps = $ReadOnly<{|
...ViewProps,
Expand All @@ -32,4 +32,4 @@ type NativeProps = $ReadOnly<{|

export default (codegenNativeComponent<NativeProps>(
'AndroidProgressBar',
): NativeComponentType<NativeProps>);
): HostComponent<NativeProps>);
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
import type {ViewProps} from '../View/ViewPropTypes';

import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
import {type NativeComponentType} from '../../Utilities/codegenNativeComponent';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';

type NativeProps = $ReadOnly<{|
...ViewProps,
Expand All @@ -32,4 +32,4 @@ type NativeProps = $ReadOnly<{|

export default (codegenNativeComponent<NativeProps>(
'RCTProgressView',
): NativeComponentType<NativeProps>);
): HostComponent<NativeProps>);
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'use strict';

import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
import {type NativeComponentType} from '../../Utilities/codegenNativeComponent';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';

import type {
DirectEventHandler,
Expand Down Expand Up @@ -67,4 +67,4 @@ type NativeProps = $ReadOnly<{|

export default (codegenNativeComponent<NativeProps>(
'AndroidSwipeRefreshLayout',
): NativeComponentType<NativeProps>);
): HostComponent<NativeProps>);
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
import type {ViewProps} from '../View/ViewPropTypes';

import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
import {type NativeComponentType} from '../../Utilities/codegenNativeComponent';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';

type NativeProps = $ReadOnly<{|
...ViewProps,
Expand Down Expand Up @@ -46,4 +46,4 @@ type NativeProps = $ReadOnly<{|

export default (codegenNativeComponent<NativeProps>('PullToRefreshView', {
paperComponentName: 'RCTRefreshControl',
}): NativeComponentType<NativeProps>);
}): HostComponent<NativeProps>);
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {ViewProps} from '../View/ViewPropTypes';
import type {WithDefault} from '../../Types/CodegenTypes';

import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
import {type NativeComponentType} from '../../Utilities/codegenNativeComponent';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';

type NativeProps = $ReadOnly<{|
...ViewProps,
Expand All @@ -25,4 +25,4 @@ type NativeProps = $ReadOnly<{|

export default (codegenNativeComponent<NativeProps>(
'RCTSafeAreaView',
): NativeComponentType<NativeProps>);
): HostComponent<NativeProps>);
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'use strict';

import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
import {type NativeComponentType} from '../../Utilities/codegenNativeComponent';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
import type {ViewProps} from '../View/ViewPropTypes';
import type {
BubblingEventHandler,
Expand Down Expand Up @@ -40,4 +40,4 @@ type NativeProps = $ReadOnly<{|

export default (codegenNativeComponent<NativeProps>(
'RCTSegmentedControl',
): NativeComponentType<NativeProps>);
): HostComponent<NativeProps>);
4 changes: 2 additions & 2 deletions Libraries/Components/Slider/SliderNativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
} from '../../Types/CodegenTypes';

import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
import {type NativeComponentType} from '../../Utilities/codegenNativeComponent';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';

import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
import type {ImageSource} from '../../Image/ImageSource';
Expand Down Expand Up @@ -57,4 +57,4 @@ type NativeProps = $ReadOnly<{|
export default (codegenNativeComponent<NativeProps>('Slider', {
interfaceOnly: true,
paperComponentName: 'RCTSlider',
}): NativeComponentType<NativeProps>);
}): HostComponent<NativeProps>);
4 changes: 2 additions & 2 deletions Libraries/Components/Switch/SwitchNativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
import type {ViewProps} from '../View/ViewPropTypes';

import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
import {type NativeComponentType} from '../../Utilities/codegenNativeComponent';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';

type SwitchChangeEvent = $ReadOnly<{|
value: boolean,
Expand All @@ -42,4 +42,4 @@ type NativeProps = $ReadOnly<{|

export default (codegenNativeComponent<NativeProps>('Switch', {
paperComponentName: 'RCTSwitch',
}): NativeComponentType<NativeProps>);
}): HostComponent<NativeProps>);
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
import type {ViewProps} from '../View/ViewPropTypes';

import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
import {type NativeComponentType} from '../../Utilities/codegenNativeComponent';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';

type NativeProps = $ReadOnly<{|
...ViewProps,
Expand All @@ -22,4 +22,4 @@ type NativeProps = $ReadOnly<{|

export default (codegenNativeComponent<NativeProps>(
'RCTInputAccessoryView',
): NativeComponentType<NativeProps>);
): HostComponent<NativeProps>);
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {WithDefault} from '../../Types/CodegenTypes';
import type {ViewProps} from '../View/ViewPropTypes';

import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
import {type NativeComponentType} from '../../Utilities/codegenNativeComponent';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';

type NativeProps = $ReadOnly<{|
...ViewProps,
Expand All @@ -25,4 +25,4 @@ type NativeProps = $ReadOnly<{|
// Do not require this file in paper builds
export default (codegenNativeComponent<NativeProps>(
'UnimplementedNativeView',
): NativeComponentType<NativeProps>);
): HostComponent<NativeProps>);

0 comments on commit 1b4eaeb

Please sign in to comment.