What is the TypeScript definition for the onAnimationIterationCapture event in React?

The right interface for onAnimationIterationCapture is AnimationEvent

Please continue reading below to see how to use it or read my guide on using React's events with TypeScript.

Interface

interface AnimationEvent<T = Element> extends SyntheticEvent<T, NativeAnimationEvent> {
    animationName: string;
    elapsedTime: number;
    pseudoElement: string;
}

Full example

import React, { AnimationEvent } from 'react';

const App = () => {
  const handleAnimationEvent = (e: AnimationEvent<HTMLDivElement>) => {
    // Do something
  };

  return <div onAnimationIterationCapture={handleAnimationEvent}>{/** Some code */}</div>;
};

export default App;

Attributes that use AnimationEvent: