@4i/modal-manager 1.1.20 → 1.1.21

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4i/modal-manager",
3
- "version": "1.1.20",
3
+ "version": "1.1.21",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
@@ -179,6 +179,8 @@ var ModalProvider = function (_a) {
179
179
  var refReducer = function (index, value) {
180
180
  modalRef.current[index] = value;
181
181
  };
182
+ if (typeof window === "undefined")
183
+ return null;
182
184
  var body = document.body;
183
185
  (0, react_dom_1.createPortal)(react_1.default.createElement(react_1.default.Fragment, null, data.length !== 0 &&
184
186
  data.map(function (item, i) {
@@ -126,6 +126,8 @@ const ModalProvider = ({
126
126
  modalRef.current[index] = value;
127
127
  };
128
128
 
129
+ if (typeof window === "undefined") return null;
130
+
129
131
  const body = document.body;
130
132
  createPortal(
131
133
  <>