Skip to content

Commit a50cf05

Browse files
committed
Add datatag support
1 parent 0347849 commit a50cf05

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/tabs/Tabs.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import React, {
55
ReactNode,
66
isValidElement,
77
ReactElement,
8+
HtmlHTMLAttributes,
89
} from 'react';
910
import { Text } from '../content';
1011
import { css } from '@emotion/core';
@@ -114,21 +115,24 @@ type TabPaneChildFCProps = { isSelected: boolean };
114115
* Function component child for lazy loading support. See storybook
115116
*/
116117
type TabPaneChildFC = (props: TabPaneChildFCProps) => ReactNode;
117-
type TabPaneProps = {
118+
interface TabPaneProps
119+
extends Omit<HtmlHTMLAttributes<HTMLDivElement>, 'children'> {
118120
name: string;
119121
children: ReactNode | TabPaneChildFC;
120122
className?: string;
121-
};
123+
}
122124

123125
export const TabPane = ({
124126
name,
125127
children,
126128
className,
127129
isSelected = false,
130+
...divProps
128131
}: TabPaneProps & { isSelected?: boolean }) => {
129132
return (
130133
<div
131134
data-tab-name={name}
135+
{...divProps}
132136
hidden={!isSelected}
133137
role="tabpanel"
134138
className={className}

0 commit comments

Comments
 (0)