Skip to content

Commit

Permalink
fix: update dependency array in layout effect
Browse files Browse the repository at this point in the history
- Added `wasCollapse` to the dependency array of the useEffect hook in `src/layouts/dashboard/layout.tsx`.
- This change ensures that the effect runs when `wasCollapse` changes, maintaining proper state synchronization.
  • Loading branch information
cswni committed Dec 3, 2024
1 parent dc16437 commit 1212470
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/layouts/dashboard/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function DashboardLayout({ children }: Props) {
dispatch(toggleMinibar());
}

}, [lgUp, minibarState, dispatch]);
}, [lgUp, minibarState, dispatch, wasCollapse]);

const renderNavMini = <><NavMini /> <NavVerticalMini /></>;
const renderNavVertical = <><NavMini /><NavVertical /></>;
Expand Down

0 comments on commit 1212470

Please sign in to comment.