This commit is contained in:
@@ -5,13 +5,13 @@ type TabProps = { name: string
|
||||
init?: boolean
|
||||
children: React.ReactNode }
|
||||
|
||||
type Props = { children: React.ReactElement<TabProps>[] }
|
||||
type Props = { children: React.ReactNode }
|
||||
|
||||
export const Tab = ({ children }: TabProps) => <>{children}</>
|
||||
|
||||
|
||||
export default ({ children }: Props) => {
|
||||
const tabs = React.Children.toArray (children)
|
||||
const tabs = React.Children.toArray (children) as React.ReactElement<TabProps>[]
|
||||
|
||||
const [current, setCurrent] = useState<number> (() => {
|
||||
const i = tabs.findIndex (tab => tab.props.init)
|
||||
|
||||
Reference in New Issue
Block a user