<div onTouchstartPassive={onTouchstartPassive}></div>
TS2322: Type '{ ref: Ref<HTMLElement | undefined>; class: unknown[]; onTouchstartPassive: (event: TouchEvent) => void; onTouchend: () => void; onTouchcancel: () => void; }' is not assignable to type 'ElementAttrs<HTMLAttributes>'.
Property 'onTouchstartPassive' does not exist on type 'ElementAttrs<HTMLAttributes>'.
但是运行 yarn lint
并没有错误提示, 请问这是为什么呢?
提示
onTouchstartPassive
不是标准的 dom 事件,应该是需要手动标注类型,请参考:为事件处理函数标注类型