Skip to content

Commit

Permalink
Update index.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
cgero-eth committed Oct 27, 2023
1 parent 9333b51 commit 80705ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/navLink/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ const NavLink = ({caller, data, onItemClick}: NavLinkProps) => {
const handleOnClick = () => {
const dao = daoMatch?.params?.dao;
onItemClick?.();
navigate(generatePath(data.path, {network, dao}));
// timeout is to allow any state changes triggered by onItemClick to take effect
// before navigation occurs, potentially unmounting components
setTimeout(() => navigate(generatePath(data.path, {network, dao})), 100);
};

if (caller === 'dropdown') {
Expand Down

0 comments on commit 80705ce

Please sign in to comment.