You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An improvement could be to use generic types so that this piece of code gets shorthanded:
<Tabsvalue={tab}onValueChange={setTab}>
Proposed type declaration
exportinterfaceTabsProps<T>extendsPrimitiveDivProps{/** The value for the selected tab, if controlled */value?: T;/** The value of the tab to select by default, if uncontrolled */defaultValue?: T;/** A function called when a new tab is selected */onValueChange?: (value: T)=>void;
...
}
Examples in other libraries
n/a
Who does this impact? Who is this for?
Folks using typescript
Additional context
n/a
The text was updated successfully, but these errors were encountered:
Feature request
Overview
The tabs component takes a
value
prop and aonValueChange
callback with these types:It would be ideal to use generic types to infer the type of the onValueChange value prop.
Imagine we have the following:
When declaring the
Tabs
component this is needed to be done in order to be type compliant:An improvement could be to use generic types so that this piece of code gets shorthanded:
Proposed type declaration
Examples in other libraries
n/a
Who does this impact? Who is this for?
Folks using typescript
Additional context
n/a
The text was updated successfully, but these errors were encountered: