the problem came from TS , complaning in this code:
onclick: {handleclick}
//the function
const handleclick = (event: MouseEvent) => console.log(event);
the complaning message:
type ‘(event: MouseEvent) => void’ is not assignable to type ‘MouseEventHandler’.
Types of parameters ‘event’ and ‘event’ are incompatible.
Type ‘MouseEvent<HTMLLIElement, MouseEvent>’ is missing the following properties from type ‘MouseEvent’: offsetX, offsetY, x, y, and 14 more.ts(2322)
index.d.ts(1521, 9): The expected type comes from property ‘onClick’ which is declared here on type ‘DetailedHTMLProps<LiHTMLAttributes, HTMLLIElement>’