UNPKG

bitmovin-player-react-native

Version:

Official React Native bindings for Bitmovin's mobile Player SDKs.

14 lines 559 B
import { useCallback } from 'react'; import { normalizeNonFinite } from '../utils/normalizeNonFinite'; /** * Create a proxy function that unwraps native events. */ export function useProxy() { return useCallback((callback) => (event) => { // Remove the target field from the event as it's React Native internal metadata const { target: _target, ...eventWithoutTarget } = event.nativeEvent; const sanitized = normalizeNonFinite(eventWithoutTarget); callback?.(sanitized); }, []); } //# sourceMappingURL=useProxy.js.map