File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,7 @@ interface TabsItem {
3838
3939interface TabsProps extends Omit < AriaTabsProps , "orientation" > {
4040 items : TabsItem [ ] ;
41- // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
42- callback ?: Function ;
41+ callback ?: ( key : Key , value : TabsItem [ "value" ] ) => void ;
4342 className ?: string ;
4443 /** ClassName to provide a common style for all TabPanels */
4544 panelClassName ?: string ;
@@ -67,7 +66,7 @@ function Tabs({
6766 const handleSelection = useCallback (
6867 ( key : Key ) => {
6968 setSelectedKey ( key ) ;
70- const selectedItem = items . find ( ( item ) => item . text === key ) ;
69+ const selectedItem = items . find ( ( item ) => item . id === key ) ;
7170 if ( selectedItem && callback ) callback ( key , selectedItem . value ) ;
7271 } ,
7372 [ items , callback ] ,
You can’t perform that action at this time.
0 commit comments