UNPKG

@applicaster/zapp-react-native-utils

Version:

Applicaster Zapp React Native utilities package

16 lines (13 loc) 418 B
import { useCallback } from "react"; import { InteractionManager, NativeModules } from "react-native"; const { ProfilerBridge } = NativeModules; export const useProfilerLogging = () => useCallback( (data: string) => InteractionManager.runAfterInteractions(() => { if (ProfilerBridge && data) { ProfilerBridge.updateTimer("navigation", data, Date.now()); } }), [] );