function useDefaultHander<T>(
  propsHander?: T,
  defaultHander?: T,
): T | undefined {
  if (propsHander === undefined) return defaultHander;
  else return propsHander;
}
const onClick = useDefaultHander<React.MouseEventHandler<HTMLDivElement>>(
  props.onClick,
  () => {
    alert("デフォルト！");
  },
);
return(<div onClick={onClick}></div>)