I have this functions and this types:
type ClickHandler = (tag: ITag) => void;
type ShowHideDropItem = (tag: ITag) => void;
my tsx:
const [menuItems, setMenuItems] = useState<ITag[]>(SideBarTags);
const clickHandler: ClickHandler = (tag) => () => {
showHideDropItem(tag);
};
const showHideDropItem: ShowHideDropItem = (tag) => {
setMenuItems((items) =>
items.map((item) => ({
...item,
Active:
item.Name === tag.Name ? (tag.Active === true ? false : true) : false,
}))
);
};
but i got this error on my onClick:
Type 'void' is not assignable to type '((event: MouseEvent) => void) | undefined'. TS2322