usePopup
The usePopup hook is used inside the Popup component. This hook handles the popup logic, inside the Popup component.
This hook is an internal hook and is not available for the users since it's not exposed as a part of this library.
Code
Explanation
It accepts a single parameter, intialValue, a boolean value (default false) - for intializing the state of popup.
It returns the following:
showPopup
- current state of popup.popupRef
- to get the reference to the container containing the popup box,popupState
- a function to close popup when clicked on close button.closePopup
- a function to close popup when clicked outside.
Last updated