Created
January 25, 2022 14:06
-
-
Save ericallam/52c466c072e332ea08f2e87868f95e97 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
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