Skip to content

Instantly share code, notes, and snippets.

@ericallam
Created January 25, 2022 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericallam/52c466c072e332ea08f2e87868f95e97 to your computer and use it in GitHub Desktop.
Save ericallam/52c466c072e332ea08f2e87868f95e97 to your computer and use it in GitHub Desktop.
type TabProps = {
defaultActiveKey: string;
className?: string;
children: ReactNode;
};
type TabContentProps = {
eventKey: string;
children: ReactNode;
title: string;
};
export function Tab({ defaultActiveKey, className, children }: TabProps) {
return <div>I am Main Tab</div>;
}
export function TabContent({ eventKey, title, children }: TabContentProps) {
return <div>I am children content</div>;
}
function App() {
return (
<Tab defaultActiveKey="foo">
<TabContent eventKey="foo" title="foo">
<div>I am foo content</div>
</TabContent>
</Tab>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment