diff --git a/Libraries/Components/Picker/AndroidDropdownPickerNativeComponent.js b/Libraries/Components/Picker/AndroidDropdownPickerNativeComponent.js index 6d2946b43fa..21b5f41e13e 100644 --- a/Libraries/Components/Picker/AndroidDropdownPickerNativeComponent.js +++ b/Libraries/Components/Picker/AndroidDropdownPickerNativeComponent.js @@ -11,13 +11,14 @@ import * as React from 'react'; import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; -import requireNativeComponent from '../../ReactNative/requireNativeComponent'; 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'; @@ -49,11 +50,9 @@ type NativeProps = $ReadOnly<{| onSelect?: DirectEventHandler, |}>; -type NativeType = HostComponent; - interface NativeCommands { +setNativeSelectedPosition: ( - viewRef: React.ElementRef, + viewRef: React.ElementRef, index: number, ) => void; } @@ -62,6 +61,22 @@ export const Commands: NativeCommands = codegenNativeCommands({ supportedCommands: ['setNativeSelectedPosition'], }); -export default (requireNativeComponent( +const AndroidDropdownPickerNativeComponent: HostComponent = NativeComponentRegistry.get( 'AndroidDropdownPicker', -): NativeType); + () => ({ + uiViewClassName: 'AndroidDropdownPicker', + 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 AndroidDropdownPickerNativeComponent;