UNPKG

@logicwind/react-native-tvos-keyboard

Version:

Native Apple TV keyboard for React Native tvOS with voice typing support.

33 lines (32 loc) 1.35 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TvosKeyboardView = void 0; var _react = _interopRequireDefault(require("react")); var _reactNative = require("react-native"); var _jsxRuntime = require("react/jsx-runtime"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } const LINKING_ERROR = `The package '@logicwind/react-native-tvos-keyboard' doesn't seem to be linked. Make sure: \n\n` + _reactNative.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 (_reactNative.Platform.OS === 'ios' && _reactNative.Platform.isTV) { if (_reactNative.UIManager.getViewManagerConfig(ComponentName) != null) { NativeKeyboardComponent = (0, _reactNative.requireNativeComponent)(ComponentName); } else { throw new Error(LINKING_ERROR); } } const TvosKeyboardView = props => { if (_reactNative.Platform.OS !== 'ios' || !_reactNative.Platform.isTV || NativeKeyboardComponent === null) { return null; } return /*#__PURE__*/(0, _jsxRuntime.jsx)(NativeKeyboardComponent, { ...props }); }; exports.TvosKeyboardView = TvosKeyboardView; //# sourceMappingURL=index.js.map