usePopup
Last updated
Last updated
The usePopup hook is used inside the 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.
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.
As you can see above it uses the and hook of the React internally for managing the state of slider on arrow click.