Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Errors in ContextMenu and DropdownMenu #23

Open
h14h opened this issue Jan 27, 2025 · 0 comments
Open

Type Errors in ContextMenu and DropdownMenu #23

h14h opened this issue Jan 27, 2025 · 0 comments

Comments

@h14h
Copy link

h14h commented Jan 27, 2025

With a fresh installation of ContextMenu and DropdownMenu, I the following type error in DropdownMenu.ios.tsx:

Property 'isUsingActionSheetFallback' does not exist on type 'OnPressMenuItemEventObject'.

Here is the full context of this error:

function toOnPressMenuItem(
  onItemPress: DropdownMenuProps["onItemPress"],
): OnPressMenuItemEvent {
  return ({ nativeEvent, isUsingActionSheetFallback }) => { // ERROR HERE
    onItemPress?.(
      {
        actionKey: nativeEvent.actionKey,
        title: nativeEvent.actionTitle,
        subTitle: nativeEvent.actionSubtitle,
        state: nativeEvent.menuState
          ? { checked: nativeEvent.menuState === "on" }
          : undefined,
        destructive: nativeEvent.menuAttributes?.includes("destructive"),
        disabled: nativeEvent.menuAttributes?.includes("disabled"),
        hidden: nativeEvent.menuAttributes?.includes("hidden"),
        keepOpenOnPress:
          nativeEvent.menuAttributes?.includes("keepsMenuPresented"),
        loading: false,
      },
      isUsingActionSheetFallback,
    );
  };
}

The OnPressMenuItemEventObject type comes from the react-native-ios-context-menu dependency, which does not have a isUsingActionSheetFallback property as of (at least) the latest version, 3.1.0.

I don't really know what isUsingActionSheetFallback is actually for in the context of the dropdown/context menus -- I can't find an example of it being used anywhere. It may be safe to simply remove from the spec of these components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant