@theoplayer/react-native-ui
Version:
A React Native UI for @theoplayer/react-native
16 lines (15 loc) • 645 B
JavaScript
import { Platform } from 'react-native';
import * as ReactNative from 'react-native';
export const useTVOSEventHandler = handler => {
let tvOSEventHandler = _handler => {}; // does nothing
// on tvOS only, try to replace the tvOSEventHandler by the useTVEventHandler hook.
if (Platform.OS === 'ios' && Platform.isTV) {
if (typeof ReactNative.useTVEventHandler === 'function') {
tvOSEventHandler = ReactNative.useTVEventHandler;
} else {
console.warn('useTVEventHandler not supported, a dependency on react-native-tvos is required.');
}
}
return tvOSEventHandler(handler);
};
//# sourceMappingURL=TVUtils.js.map