@hyext-beyond/hy-ui-native
Version:
A native lib polyfill for huya miniapp
23 lines • 767 B
JavaScript
import { NativeModules } from "react-native";
export function showInputBar(props) {
return new Promise(function (resolve, reject) {
var _NativeModules$HYExtI;
var api = NativeModules == null || (_NativeModules$HYExtI = NativeModules.HYExtInputBar) == null ? void 0 : _NativeModules$HYExtI.showInputBar;
if (api != null) {
api({
text: props.text,
placeholder: props.placeholder
}).then(function (text) {
resolve({
text: text
});
})["catch"](function (e) {
console.log("native input err", e.message);
reject(e);
});
} else {
reject(new Error('The current env not exist Api of NativeModules.HYExtInputBar.showInputBar'));
}
});
}
export default showInputBar;