Created
January 11, 2019 10:49
-
-
Save daniele-zurico/108cc245335781444f53946609c89244 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 Tab = ({ id, children }: any) => { | |
const tab = useContext(context); | |
return <div onClick={() => tab.changeTab(id)}>{children}</div>; | |
}; | |
const TabPanel = ({ whenActive, children }: any) => { | |
const tab = useContext(context); | |
return tab.activeTabId === whenActive ? children : null; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment