refactor: return value as Tabsection from isTabSection fn (avoids assertion at setState level)

This commit is contained in:
lemmyMwaura
2024-07-28 07:50:27 +03:00
parent 06900b9c99
commit f5bc4e1b5f
3 changed files with 6 additions and 4 deletions
@@ -1,6 +1,7 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';
import { Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
import { withPermission } from "@app/hoc";
@@ -17,7 +18,7 @@ export const MembersPage = withPermission(
useEffect(() => {
if (selectedTab && isTabSection(selectedTab)) {
setActiveTab(selectedTab as TabSections);
setActiveTab(selectedTab);
}
}, [isTabSection, selectedTab]);