react-intersection-loader
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -76,6 +76,7 @@ var __assign = (this && this.__assign) || function () { | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import { lazy, useCallback, useLayoutEffect, useRef, useState, } from 'react'; | ||
import { lazy, useCallback, useEffect, useLayoutEffect, useRef, useState, } from 'react'; | ||
import { LoaderError } from './error'; | ||
import { interopDefault } from './interop-default'; | ||
import { WithSuspense } from './with-suspense'; | ||
var useIsomorphicLayoutEffect = typeof document !== 'undefined' ? useLayoutEffect : useEffect; | ||
/** | ||
@@ -127,3 +128,3 @@ * | ||
}); }, []); | ||
useLayoutEffect(function () { | ||
useIsomorphicLayoutEffect(function () { | ||
if (!('IntersectionObserver' in window)) { | ||
@@ -130,0 +131,0 @@ throw new LoaderError('Intersection observer is not supported'); |
{ | ||
"name": "react-intersection-loader", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Load react component lazily when the component is visible", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -14,3 +14,3 @@ # React Intersection Loader | ||
// This is will be imported (lazy loaded) only when the user is about to see it. | ||
// This will be imported (lazy loaded) only when the user is about to see it. | ||
const MyComponent = intersectionLoader(() => import('./MyComponent')); | ||
@@ -17,0 +17,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43940
320