react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

Added FrameTimings to the useFrameCallback hook

Open Kwasow opened this issue 3 years ago • 0 comments

Description

This PR adds timing info to callback passed to useFrameCallback.

Changes

New type:

type FrameTimings = {
  timestamp: number;
  frameTime: number | null;
  elapsedTime: number;
};

Before

function useFrameCallback(
  callback: () => void,
  autostart = true
): FrameCallback

After

function useFrameCallback(
  callback: (frameInfo: FrameTimings) => void,
  autostart = true
): FrameCallback

Checklist

  • [x] Included code example that can be used to test this change
  • [x] Updated TS types
  • [ ] Added TS types tests
  • [ ] Added unit / integration tests
  • [x] Updated documentation
  • [x] Ensured that CI passes

Kwasow avatar Aug 09 '22 09:08 Kwasow