Files
react-native/packages/react-native-popup-menu-android/js/PopupMenuAndroidNativeComponent.android.js
Rubén Norte e0a6a9f465 Remove deep imports from generated Codegen modules (#58603)
Summary:
Pull Request resolved: https://github.com/react/react-native/pull/58603

Generate view configs and Codegen fixtures using supported React Native entry points or values derived from their exports. Generated view config modules can be emitted into arbitrary consumer package locations, so they cannot use a package-relative path back into React Native. Keep `ConditionallyIgnoredEventHandlers` centralized and expose it from the explicitly unstable compatibility entry point instead of duplicating its platform-specific semantics in generated output.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D120717571

fbshipit-source-id: 9f3ea06d393eb8702bbb3ef2767c2d7c5fde1315
2026-09-21 11:31:38 -07:00

45 lines
1.1 KiB
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and 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
*/
import type {CodegenTypes, HostComponent, ViewProps} from 'react-native';
import * as React from 'react';
import {codegenNativeCommands, codegenNativeComponent} from 'react-native';
type PopupMenuSelectionEvent = Readonly<{
item: CodegenTypes.Int32,
}>;
type PopupMenuDismissEvent = Readonly<{}>;
type NativeProps = Readonly<{
...ViewProps,
//Props
menuItems?: ?ReadonlyArray<string>,
onPopupMenuSelectionChange?: CodegenTypes.DirectEventHandler<PopupMenuSelectionEvent>,
onPopupMenuDismiss?: CodegenTypes.DirectEventHandler<PopupMenuDismissEvent>,
}>;
type ComponentType = HostComponent<NativeProps>;
interface NativeCommands {
readonly show: (viewRef: React.ElementRef<ComponentType>) => void;
}
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
supportedCommands: ['show'],
});
export default codegenNativeComponent<NativeProps>(
'AndroidPopupMenu',
) as HostComponent<NativeProps>;