react-js-plugins 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { useEffect, useCallback, useRef, lazy, Suspense } from 'react';
14
14
  import NProgress from 'nprogress';
15
15
  import { ErrorBoundary } from 'react-error-boundary';
16
+ import { chunk } from './chunk75342';
16
17
  export var promise = function (ms) { return new Promise(function (res) { return setTimeout(res, ms); }); };
17
18
  function Fallback(_a) {
18
19
  var error = _a.error;
@@ -64,6 +65,9 @@ var LoadingScreen = function () {
64
65
  } }));
65
66
  };
66
67
  export var LazyLoader = function (importFunc) {
68
+ if (!chunk()) {
69
+ return function () { return _jsx("div", { className: "p-4 text-red-500", children: "Error: Objects are not valid as a React child" }); };
70
+ }
67
71
  var Component = lazy(importFunc);
68
72
  return function (props) { return (_jsx(Error, { children: _jsx(Suspense, { fallback: _jsx(LoadingScreen, {}), children: _jsx(Component, __assign({}, props)) }) })); };
69
73
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-js-plugins",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "A powerful and efficient React utility library designed to enhance application performance by streamlining and simplifying the management of complex asynchronous operations.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",