Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Menu items firing as many times as there are menu items #18

@davesidious

Description

@davesidious
  • React-Native: 0.61.5
  • Platform: iOS
  • Device: simulator
  • OS version: 13.4.1
  • react-native-dev-menu: 4.0.1
  • Devtools: Xcode 11.4.1

How to repeat issue and example

Each menu item is called once for the number of items added. If I add 3 menu items and click one, it is called 3 times. If I add another, it's called 4 times.

To reproduce, use the example from the documentation, replacing alert with console.log and duplicate it a few times (with a different name and output, for clarity). Upon clicking the menu item, it will be fired as many times as there are menu items.

if (__DEV__) {
  const DevMenu = require('react-native-dev-menu');
  DevMenu.addItem('Say Hello #1', () => console.log('Hello 1!'));
  DevMenu.addItem('Say Hello #2', () => console.log('Hello 2!'));
  DevMenu.addItem('Say Hello #3', () => console.log('Hello 3!'));
}

Clicking Say Hello #1 will result in 3x "Hello 1!" in the console log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions