16 lines
412 B
TypeScript
16 lines
412 B
TypeScript
import { useState } from 'react';
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
export default function useTabs(defaultValues?: string) {
|
|
const [currentTab, setCurrentTab] = useState(defaultValues || '');
|
|
|
|
return {
|
|
currentTab,
|
|
onChangeTab: (event: React.SyntheticEvent<Element, Event>, newValue: any) => {
|
|
setCurrentTab(newValue);
|
|
},
|
|
setCurrentTab,
|
|
};
|
|
}
|