@sheinx/hooks 3.4.5-beta.3 → 3.4.5-beta.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"use-in-view.d.ts","sourceRoot":"","sources":["use-in-view.ts"],"names":[],"mappings":";AAIA,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,QAAA,MAAM,SAAS,oCAAoC,gBAAgB;;;;CAqClE,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"use-in-view.d.ts","sourceRoot":"","sources":["use-in-view.ts"],"names":[],"mappings":";AAIA,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,QAAA,MAAM,SAAS,oCAAoC,gBAAgB;;;;CA2ClE,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -25,6 +25,11 @@ var useInView = function useInView() {
25
25
  (0, _react.useEffect)(function () {
26
26
  var element = elementRef.current;
27
27
  if (!element) return;
28
+ if (typeof window === 'undefined' || !window.IntersectionObserver) {
29
+ setIsInView(true);
30
+ setWasInView(true);
31
+ return;
32
+ }
28
33
  var observer = new IntersectionObserver(function (_ref) {
29
34
  var _ref2 = _slicedToArray(_ref, 1),
30
35
  entry = _ref2[0];
@@ -1 +1 @@
1
- {"version":3,"file":"use-in-view.d.ts","sourceRoot":"","sources":["use-in-view.ts"],"names":[],"mappings":";AAIA,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,QAAA,MAAM,SAAS,oCAAoC,gBAAgB;;;;CAqClE,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"use-in-view.d.ts","sourceRoot":"","sources":["use-in-view.ts"],"names":[],"mappings":";AAIA,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,QAAA,MAAM,SAAS,oCAAoC,gBAAgB;;;;CA2ClE,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -19,6 +19,11 @@ var useInView = function useInView() {
19
19
  useEffect(function () {
20
20
  var element = elementRef.current;
21
21
  if (!element) return;
22
+ if (typeof window === 'undefined' || !window.IntersectionObserver) {
23
+ setIsInView(true);
24
+ setWasInView(true);
25
+ return;
26
+ }
22
27
  var observer = new IntersectionObserver(function (_ref) {
23
28
  var _ref2 = _slicedToArray(_ref, 1),
24
29
  entry = _ref2[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.4.5-beta.3",
3
+ "version": "3.4.5-beta.5",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",