Created
January 11, 2019 10:46
-
-
Save daniele-zurico/58f390762309a6608d15c52b9887657e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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