Skip to content

Instantly share code, notes, and snippets.

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