Skip to content

Commit

Permalink
♻️ Get rid of ts lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
wenche committed Nov 9, 2020
1 parent 6ca4756 commit 3a81d16
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libraries/core-react/src/Tabs/TabList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import React, {
useEffect,
ReactElement,
HTMLAttributes,
ButtonHTMLAttributes,
RefAttributes,
} from 'react'
import styled from 'styled-components'
import { useCombinedRefs } from '../_common/useCombinedRefs'
Expand Down Expand Up @@ -42,7 +44,8 @@ type TabListProps = {
type TabChild = {
disabled?: boolean
index?: number
} & JSX.IntrinsicElements['button'] &
} & ButtonHTMLAttributes<HTMLButtonElement> &
RefAttributes<HTMLButtonElement> &
ReactElement

const TabList = forwardRef<HTMLDivElement, TabListProps>(function TabsList(
Expand Down Expand Up @@ -77,7 +80,7 @@ const TabList = forwardRef<HTMLDivElement, TabListProps>(function TabsList(
(child: TabChild, index: number) => {
const tabRef =
index === activeTab
? useCombinedRefs(child.ref, selectedTabRef)
? useCombinedRefs<HTMLButtonElement>(child.ref, selectedTabRef)
: child.ref

return React.cloneElement(child, {
Expand Down

0 comments on commit 3a81d16

Please sign in to comment.