Skip to content

Commit 7c4c260

Browse files
mr-nobody-7vivekg734huyenltnguyen
authored
fix(tabs): correct props interfaces of TabsTrigger and TabsList (#597)
Co-authored-by: vivekg734 <vivekananda.g@syncoffice.com> Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
1 parent 8afac90 commit 7c4c260

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/tabs/tabs.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
import React, { type ComponentPropsWithoutRef } from "react";
2-
import { Root, List, Trigger, Content } from "@radix-ui/react-tabs";
1+
import React from "react";
2+
import {
3+
Root,
4+
List,
5+
Trigger,
6+
Content,
7+
type TabsTriggerProps,
8+
type TabsListProps,
9+
} from "@radix-ui/react-tabs";
310

411
const buttonClassNames =
512
"flex-1 block relative px-2.5 py-[5px] text-sm text-foreground-secondary border-none aria-selected:font-bold aria-selected:bg-foreground-quaternary aria-selected:text-background-secondary hover:bg-background-quaternary";
@@ -10,15 +17,15 @@ const listClassNames =
1017

1118
export const TabsTrigger = React.forwardRef<
1219
React.ElementRef<typeof Trigger>,
13-
ComponentPropsWithoutRef<typeof Trigger>
20+
TabsTriggerProps
1421
>(({ className, ...props }, ref) => {
1522
const triggerClasses = [buttonClassNames, className].join(" ");
1623
return <Trigger ref={ref} className={triggerClasses} {...props} />;
1724
});
1825

1926
export const TabsList = React.forwardRef<
2027
React.ElementRef<typeof List>,
21-
ComponentPropsWithoutRef<typeof List>
28+
TabsListProps
2229
>(({ className, ...props }, ref) => {
2330
const listClasses = [listClassNames, className].join(" ");
2431
return <List ref={ref} className={listClasses} {...props} />;

0 commit comments

Comments
 (0)