@4i/modal-manager 1.1.20 → 1.1.21

Sign up to get free protection for your applications and to get access to all the features.
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
  <>