@logicwind/react-native-tvos-keyboard
Version:
Native Apple TV keyboard for React Native tvOS with voice typing support.
27 lines (26 loc) • 1.02 kB
JavaScript
;
import React from 'react';
import { requireNativeComponent, UIManager, Platform } from 'react-native';
import { jsx as _jsx } from "react/jsx-runtime";
const LINKING_ERROR = `The package '@logicwind/react-native-tvos-keyboard' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
ios: "- You have run 'pod install'\n",
default: ''
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
const ComponentName = 'TvosKeyboardView';
let NativeKeyboardComponent = null;
if (Platform.OS === 'ios' && Platform.isTV) {
if (UIManager.getViewManagerConfig(ComponentName) != null) {
NativeKeyboardComponent = requireNativeComponent(ComponentName);
} else {
throw new Error(LINKING_ERROR);
}
}
export const TvosKeyboardView = props => {
if (Platform.OS !== 'ios' || !Platform.isTV || NativeKeyboardComponent === null) {
return null;
}
return /*#__PURE__*/_jsx(NativeKeyboardComponent, {
...props
});
};
//# sourceMappingURL=index.js.map