Skip to content

Commit

Permalink
fix(HeaderContainer): use previous state (#7890)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
kalbert312 and kodiakhq[bot] authored Feb 24, 2021
1 parent 446f67d commit 8322ccd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/react/src/components/UIShell/HeaderContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ const HeaderContainer = ({ isSideNavExpanded, render: Children }) => {
);

const handleHeaderMenuButtonClick = useCallback(() => {
setIsSideNavExpandedState(!isSideNavExpandedState);
}, [isSideNavExpandedState, setIsSideNavExpandedState]);
setIsSideNavExpandedState(
(prevIsSideNavExpanded) => !prevIsSideNavExpanded
);
}, [setIsSideNavExpandedState]);

return (
<Children
Expand Down

0 comments on commit 8322ccd

Please sign in to comment.