one
Version:
One is a React framework for web, iOS, and Android apps.
50 lines (47 loc) • 1.82 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all) __defProp(target, name, {
get: all[name],
enumerable: true
});
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var nativeTabsOptions_exports = {};
__export(nativeTabsOptions_exports, { processNativeTabsScreens: () => processNativeTabsScreens });
module.exports = __toCommonJS(nativeTabsOptions_exports);
function processNativeTabsScreens(screens) {
return screens.map(function(screen) {
if (typeof screen.options === "function") {
var getOptions = screen.options;
return {
...screen,
options: function options(props) {
var options2 = getOptions(props);
assertNoNativeTabsHref(screen.name, options2);
return options2;
}
};
}
assertNoNativeTabsHref(screen.name, screen.options);
return screen;
});
}
function assertNoNativeTabsHref(screenName, options) {
if (options && "href" in options) {
throw new Error(`Tabs.Screen "${screenName !== null && screenName !== void 0 ? screenName : ""}" uses the web-only href option. Native tabs use the route name. Put non-tab routes in a parent Stack, and move custom href options to a .web layout.`);
}
}
//# sourceMappingURL=nativeTabsOptions.native.js.map