Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix tab props

Jonathan Summers-Muirff192066bde7
diff --git a/packages/ui/src/components/Tabs/Tabs.tsx b/packages/ui/src/components/Tabs/Tabs.tsx
index a65deb8572d..aba66a6dfea 100644
--- a/packages/ui/src/components/Tabs/Tabs.tsx
+++ b/packages/ui/src/components/Tabs/Tabs.tsx
@@ -23,6 +23,7 @@ interface TabsProps {
addOnBefore?: React.ReactNode
addOnAfter?: React.ReactNode
listClassNames?: string
+ children: PanelPropsProps[]
}
interface TabsSubComponents {
@@ -30,7 +31,6 @@ interface TabsSubComponents {
}
const Tabs: React.FC<TabsProps> & TabsSubComponents = ({
- children,
defaultActiveId,
activeId,
type = 'pills',
@@ -42,6 +42,7 @@ const Tabs: React.FC<TabsProps> & TabsSubComponents = ({
addOnBefore,
addOnAfter,
listClassNames,
+ children,
}) => {
const [activeTab, setActiveTab] = React.useState(
defaultActiveId
@@ -86,7 +87,7 @@ const Tabs: React.FC<TabsProps> & TabsSubComponents = ({
<TabsPrimitive.Root defaultValue={defaultActiveId} value={active} className={__styles.base}>
<TabsPrimitive.List className={listClasses.join(' ')}>
{addOnBefore}
- {children.map((tab: any) => {
+ {children.map((tab) => {
const activeMatch = active === tab.props.id
const triggerClasses = [__styles[type].base, __styles.size[size]]
@@ -125,6 +126,11 @@ const Tabs: React.FC<TabsProps> & TabsSubComponents = ({
)
}
+// bit of a hack because we map over the JSX in the parent component
+interface PanelPropsProps {
+ props: PanelProps
+}
+
interface PanelProps {
id: string
label?: string