diff --git a/Libraries/Components/Picker/AndroidDialogPickerNativeComponent.js b/Libraries/Components/Picker/AndroidDialogPickerNativeComponent.js index a831311f2b..d1ac537d06 100644 --- a/Libraries/Components/Picker/AndroidDialogPickerNativeComponent.js +++ b/Libraries/Components/Picker/AndroidDialogPickerNativeComponent.js @@ -11,15 +11,13 @@ import * as React from 'react'; import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; -import requireNativeComponent from '../../ReactNative/requireNativeComponent'; -import registerGeneratedViewConfig from '../../Utilities/registerGeneratedViewConfig'; -import AndroidDialogPickerViewConfig from './AndroidDialogPickerViewConfig'; import type { DirectEventHandler, Int32, WithDefault, } from '../../Types/CodegenTypes'; +import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry'; import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {TextStyleProp} from '../../StyleSheet/StyleSheet'; import type {ColorValue} from '../../StyleSheet/StyleSheet'; @@ -64,17 +62,22 @@ export const Commands: NativeCommands = codegenNativeCommands({ supportedCommands: ['setNativeSelectedPosition'], }); -let AndroidDialogPickerNativeComponent; -if (global.RN$Bridgeless) { - registerGeneratedViewConfig( - 'AndroidDialogPicker', - AndroidDialogPickerViewConfig, - ); - AndroidDialogPickerNativeComponent = 'AndroidDialogPicker'; -} else { - AndroidDialogPickerNativeComponent = requireNativeComponent( - 'AndroidDialogPicker', - ); -} +const AndroidDialogPickerNativeComponent: HostComponent = NativeComponentRegistry.get( + 'AndroidDialogPicker', + () => ({ + uiViewClassName: 'AndroidDialogPicker', + bubblingEventTypes: {}, + directEventTypes: {}, + validAttributes: { + color: {process: require('../../StyleSheet/processColor')}, + backgroundColor: {process: require('../../StyleSheet/processColor')}, + enabled: true, + items: true, + prompt: true, + selected: true, + onSelect: true, + }, + }), +); export default ((AndroidDialogPickerNativeComponent: any): NativeType); diff --git a/Libraries/Components/Picker/AndroidDialogPickerViewConfig.js b/Libraries/Components/Picker/AndroidDialogPickerViewConfig.js deleted file mode 100644 index 4400061636..0000000000 --- a/Libraries/Components/Picker/AndroidDialogPickerViewConfig.js +++ /dev/null @@ -1,30 +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 strict-local - * @format - */ - -'use strict'; - -import type {PartialViewConfig} from 'react-native/Libraries/Renderer/shims/ReactNativeTypes'; - -const AndroidDialogPickerViewConfig = { - uiViewClassName: 'AndroidDialogPicker', - bubblingEventTypes: {}, - directEventTypes: {}, - validAttributes: { - color: {process: require('../../StyleSheet/processColor')}, - backgroundColor: {process: require('../../StyleSheet/processColor')}, - enabled: true, - items: true, - prompt: true, - selected: true, - onSelect: true, - }, -}; - -module.exports = (AndroidDialogPickerViewConfig: PartialViewConfig);