diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js b/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js index 731b6f3fb2..213f1d0e79 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js @@ -18,6 +18,8 @@ import type { import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; import type {ViewProps} from '../View/ViewPropTypes'; +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); + type NativeProps = $ReadOnly<{| ...ViewProps, @@ -61,4 +63,6 @@ type ActivityIndicatorNativeType = CodegenNativeComponent< Options, >; -module.exports = ((require('./ActivityIndicatorViewNativeViewConfig'): any): ActivityIndicatorNativeType); +module.exports = ((requireNativeComponent( + 'RCTActivityIndicatorView', +): any): ActivityIndicatorNativeType); diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeViewConfig.js b/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeViewConfig.js deleted file mode 100644 index 0e448d1d21..0000000000 --- a/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeViewConfig.js +++ /dev/null @@ -1,45 +0,0 @@ - -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow - */ - -'use strict'; - -const ReactNativeViewConfigRegistry = require('ReactNativeViewConfigRegistry'); -const ReactNativeViewViewConfig = require('ReactNativeViewViewConfig'); -const verifyComponentAttributeEquivalence = require('verifyComponentAttributeEquivalence'); - -const ActivityIndicatorViewViewConfig = { - uiViewClassName: 'RCTActivityIndicatorView', - Commands: {}, - - bubblingEventTypes: { - ...ReactNativeViewViewConfig.bubblingEventTypes, - }, - - directEventTypes: { - ...ReactNativeViewViewConfig.directEventTypes, - }, - - validAttributes: { - ...ReactNativeViewViewConfig.validAttributes, - hidesWhenStopped: true, - animating: true, - color: { process: require('processColor') }, - size: true, - }, -}; - -verifyComponentAttributeEquivalence('RCTActivityIndicatorView', ActivityIndicatorViewViewConfig); - -ReactNativeViewConfigRegistry.register( - 'RCTActivityIndicatorView', - () => ActivityIndicatorViewViewConfig, -); - -module.exports = 'RCTActivityIndicatorView'; // RCT prefix present for paper support diff --git a/Libraries/Components/Slider/SliderNativeComponent.js b/Libraries/Components/Slider/SliderNativeComponent.js index a100656c27..d7d90e0cda 100644 --- a/Libraries/Components/Slider/SliderNativeComponent.js +++ b/Libraries/Components/Slider/SliderNativeComponent.js @@ -22,6 +22,8 @@ import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; import type {ImageSource} from '../../Image/ImageSource'; import type {ViewProps} from '../View/ViewPropTypes'; +const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); + type Event = $ReadOnly<{| value: Float, fromUser?: boolean, @@ -59,4 +61,4 @@ type Options = { type SliderType = CodegenNativeComponent<'Slider', NativeProps, Options>; -module.exports = ((require('SliderNativeViewConfig'): any): SliderType); +module.exports = ((requireNativeComponent('RCTSlider'): any): SliderType); diff --git a/Libraries/Components/Slider/SliderNativeViewConfig.js b/Libraries/Components/Slider/SliderNativeViewConfig.js deleted file mode 100644 index 92abe05683..0000000000 --- a/Libraries/Components/Slider/SliderNativeViewConfig.js +++ /dev/null @@ -1,76 +0,0 @@ - -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow - */ - -'use strict'; - -const ReactNativeViewConfigRegistry = require('ReactNativeViewConfigRegistry'); -const ReactNativeViewViewConfig = require('ReactNativeViewViewConfig'); -const verifyComponentAttributeEquivalence = require('verifyComponentAttributeEquivalence'); - -const SliderViewConfig = { - uiViewClassName: 'RCTSlider', - Commands: {}, - - bubblingEventTypes: { - ...ReactNativeViewViewConfig.bubblingEventTypes, - - topChange: { - phasedRegistrationNames: { - captured: 'onChangeCapture', - bubbled: 'onChange', - }, - }, - - topValueChange: { - phasedRegistrationNames: { - captured: 'onValueChangeCapture', - bubbled: 'onValueChange', - }, - }, - }, - - directEventTypes: { - ...ReactNativeViewViewConfig.directEventTypes, - - topSlidingComplete: { - registrationName: 'onSlidingComplete', - }, - }, - - validAttributes: { - ...ReactNativeViewViewConfig.validAttributes, - disabled: true, - enabled: true, - maximumTrackImage: { process: require('resolveAssetSource') }, - maximumTrackTintColor: { process: require('processColor') }, - maximumValue: true, - minimumTrackImage: { process: require('resolveAssetSource') }, - minimumTrackTintColor: { process: require('processColor') }, - minimumValue: true, - step: true, - testID: true, - thumbImage: { process: require('resolveAssetSource') }, - thumbTintColor: { process: require('processColor') }, - trackImage: { process: require('resolveAssetSource') }, - value: true, - onChange: true, - onValueChange: true, - onSlidingComplete: true, - }, -}; - -verifyComponentAttributeEquivalence('RCTSlider', SliderViewConfig); - -ReactNativeViewConfigRegistry.register( - 'RCTSlider', - () => SliderViewConfig, -); - -module.exports = 'RCTSlider'; // RCT prefix present for paper support diff --git a/packages/react-native-codegen/src/cli/viewconfigs/generate-view-configs-cli.js b/packages/react-native-codegen/src/cli/viewconfigs/generate-view-configs-cli.js index 8e73febfc2..68fc84cb1f 100644 --- a/packages/react-native-codegen/src/cli/viewconfigs/generate-view-configs-cli.js +++ b/packages/react-native-codegen/src/cli/viewconfigs/generate-view-configs-cli.js @@ -23,11 +23,7 @@ const yargv = yargs.strict().option('t', { const argv = yargv.argv; const fileList = argv._[0].split('\n'); -const CURRENT_VIEW_CONFIG_FILES = [ - 'SliderNativeComponent.js', - 'ActivityIndicatorViewNativeComponent.js', - 'PullToRefreshViewNativeComponent.js', -]; +const CURRENT_VIEW_CONFIG_FILES = []; generate( fileList.filter(fileName =>