const TabSwitcher = ({ children }: any) => { | |
const [activeTabId, setActiveTab] = useState<string>("a"); | |
const changeTab = (newTabId: any) => { | |
setActiveTab(newTabId); | |
}; | |
return ( | |
<context.Provider | |
value={{ | |
activeTabId: activeTabId, | |
changeTab: changeTab | |
}} | |
> | |
{children} | |
</context.Provider> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment