Home > Back-end >  getting typescript error in react mui while creating tabs?
getting typescript error in react mui while creating tabs?

Time:01-08

I am creating custom hook of accordion component . I am getting below error

export default const Tabs: OverridableComponent<TabsTypeMap<{}, ExtendButtonBase<ButtonBaseTypeMap<{}, "button">>>>

here is my code enter image description here

CodePudding user response:

In your useTabs you should change change React.ChangeEvent to React.SyntheticEvent as the signature of onChange is function(event: React.SyntheticEvent, value: any) => void in <Tabs /> : https://mui.com/material-ui/api/tabs/

  • Related