1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3    return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6exports.withErrorOverlay = void 0;
7const react_1 = __importDefault(require("react"));
8// TODO: This will break tree shaking due to how we transpile this package.
9const react_native_1 = require("react-native");
10const ErrorToastContainer_1 = __importDefault(require("./toast/ErrorToastContainer"));
11if (!global.setImmediate) {
12    global.setImmediate = function (fn) {
13        return setTimeout(fn, 0);
14    };
15}
16if (process.env.NODE_ENV === 'development') {
17    if (react_native_1.Platform.OS === 'web') {
18        // Stack traces are big with React Navigation
19        require('./LogBox').default.install();
20    }
21}
22function withErrorOverlay(Comp) {
23    if (process.env.NODE_ENV === 'production') {
24        return Comp;
25    }
26    return function ErrorOverlay(props) {
27        return (react_1.default.createElement(ErrorToastContainer_1.default, null,
28            react_1.default.createElement(Comp, { ...props })));
29    };
30}
31exports.withErrorOverlay = withErrorOverlay;
32//# sourceMappingURL=index.js.map