instea/react-native-popup-menu

How do I close the inside of the popover

JonsonHI opened this issue · 4 comments

I need to close this window manually when it pops up
Is there any corresponding API? Where should I write it

<Text onPress={()=>{close}}> onpress(close)

<Menu  renderer={Popover} rendererProps={{ placement: 'top', anchorStyle: { backgroundColor: '#EBF7FF', left: 50, width: 20, height: 20 } }}>
                                    <MenuTrigger style={styles.menuTrigger} >
                                        <Text style={{ color: '#9C7063', fontSize: ScaleText(22) }}>{item}</Text>
                                    </MenuTrigger>
                                    <MenuOptions
                                        customStyles={{ bottom: 30 }}
                                        optionsContainerStyle={styles.innerMenuOptions}
                                    >
                                        <View
                                            style={{
                                                width: ScaleSize(144),
                                                height: ScaleSize(90),
                                                backgroundColor: '#EBF7FF',
                                                borderRadius: 20,
                                                padding: ScaleSize(20),
                                                alignItems: 'center',
                                                justifyContent: 'center'
                                            }}
                                        >
                                            <Text **onPress={()=>{close}}**> onpress</Text>
                                    </MenuOptions>
                                </Menu>

there are multiple ways - you can make your menu controlled or just call imperative functions (per instance or via context)... your choice. see documentation https://github.com/instea/react-native-popup-menu/blob/master/doc/api.md

有多种方法-您可以控制菜单或仅调用命令式函数(按实例或通过上下文)...选择。参见文档https://github.com/instea/react-native-popup-menu/blob/master/doc/api.md

Can you give me an example
I tried a few times but it didn't work
Thank you very much

there are multiple ways - you can make your menu controlled or just call imperative functions (per instance or via context)... your choice. see documentation https://github.com/instea/react-native-popup-menu/blob/master/doc/api.md

That's done thank you very much