Jump to content
Search Community

Pim de Wit

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by Pim de Wit

  1. 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

×
×
  • Create New...