Last active
August 2, 2023 16:46
-
-
Save alpavlove/07b8b3580e78dca1e344d7bfb615a733 to your computer and use it in GitHub Desktop.
Basic Tabs component - Tabs component with logic
This file contains hidden or 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
import React from "react" | |
type Props = { | |
title: string | |
index: number | |
setSelectedTab: (index: number) => void | |
} | |
const TabTitle: React.FC<Props> = ({ title, setSelectedTab, index }) => { | |
return ( | |
<li> | |
<button onClick={() => setSelectedTab(index)}>{title}</button> | |
</li> | |
) | |
} | |
export default TabTitle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment