useSidebar
The useSidebar hook is used inside the Navbar component. This hook handles the sidebar logic, inside the navbar component shown on mobile devices.
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
As you can see above it uses the useState hook of the React internally for handling the sidebar shown on mobile devices.
It accepts a single parameter,
initialValue
, a boolean value (default false).It returns the following:
sidebarStatus
- the current state of the sidebar,openSidebar
- a function for opening the sidebar andcloseSideBar
- a function for closing the sidebar.
Last updated