gsap/react contextSafe callback types in GSAP Posted January 16 Hi, I am using TypeScript with React and GSAP. Is there a way to correctly type event callbacks that are wrapped with `contextSafe`? const onPointerMove = contextSafe((event: React.PointerEvent) => {}); ... // TS2322: Type Function is not assignable to type PointerEventHandler<HTMLDivElement> <div onPointerMove={onPointerMove}/> Here is a demo: See the Pen eYXgXXY by pimdewit (@pimdewit) on CodePen
gsap/react contextSafe callback types
in GSAP
Posted
Hi,
I am using TypeScript with React and GSAP.
Is there a way to correctly type event callbacks that are wrapped with `contextSafe`?
const onPointerMove = contextSafe((event: React.PointerEvent) => {});
...
// TS2322: Type Function is not assignable to type PointerEventHandler<HTMLDivElement>
<div onPointerMove={onPointerMove}/>
Here is a demo:
See the Pen eYXgXXY by pimdewit (@pimdewit) on CodePen