Relative Content

Tag Archive for javascriptreactjsreact-hooksreact-context

Flyout menu using react context re-opens when closing it with its button

I am coding a FlyoutManager from which I can toggle every flyout menus in react app. I am trying to set the property to close when clicking outside. I found on another stackoverflow question that my clicking-outside function is triggered when I click the button to close it so it re-opens the flyout menu because it toggles the menu state twice.