Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.