undefined is not an object (evaluating 't._getOpenedMenu().instance'
Getting this crash from play console
com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 't._getOpenedMenu().instance'), stack:
_onBackdropPress@729:1065
touchableHandlePress@263:844
_performSideEffectsForTransition@256:8508
_receiveSignal@256:7291
touchableHandleResponderRelease@256:4735
hi there. do you know how to reproduce this?
It happens when you click multiple times fastly in MenuTrigger
Here is the code i user for showing popup menu
<Menu
opened={this.state.opened}
onBackdropPress={() => this.setState({ opened: false })}
onSelect={value => { }}
>
<MenuTrigger onPress={() => this.setState({ opened: true })}
customStyles={triggerStyles}>
<IonIcon name={iconName} color={Colors.BLACK_80} size={25} style={{ paddingVertical: 5, paddingHorizontal: 8 }} />
</MenuTrigger>
<MenuOptions customStyles={OptionsCustomStyle} >
{
options.map((item, index) => (
<MenuOption text={item} key={index} customStyles={OptionCustomStyle}
onSelect={() => {
this.setState({ opened: false })
onSelectOptions(item)
}
}
/>
))
}
</MenuOptions>
</Menu>
thanks. Which version of RN and popup menu do you use?
it got fixed when I removed all the props from Menu component
opened={this.state.opened}
onBackdropPress={() => this.setState({ opened: false })}
onSelect={value => { }}
<Menu>
<MenuTrigger onPress={() => this.setState({ opened: true })}
customStyles={triggerStyles}>
<IonIcon name={iconName} color={Colors.BLACK_80} size={25} style={{ paddingVertical: 5, paddingHorizontal: 8 }} />
</MenuTrigger>
<MenuOptions customStyles={OptionsCustomStyle} >
{
options.map((item, index) => (
<MenuOption text={item} key={index} customStyles={OptionCustomStyle}
onSelect={() => {
this.setState({ opened: false })
onSelectOptions(item)
}
}
/>
))
}
</MenuOptions>
</Menu>
thanks for letting us know. I will reopen this issue so that I can "re-check" the controlled menu.
Not sure if it's the same error message. But I also was getting crashes when I double clicked menu options (both clicks on the same option as well if it were different options).
I had the onSelect on the Menu. Moving it to MenuOption instead resolved the issue.
On iOS only, no issue when on Android