Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-intersection-loader

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-intersection-loader - npm Package Compare versions

Comparing version 0.0.4 to 0.1.0

22

dist/intersection-loader.d.ts

@@ -7,2 +7,7 @@ import { AllHTMLAttributes, ComponentType, ReactNode } from 'react';

* https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver#parameters
*
* @default
* - rootMargin: '250px'
* - threshold: 0.1
*
*/

@@ -13,10 +18,18 @@ intersectionObserverOptions?: IntersectionObserverInit;

* This uses `React.lazy`
*
* @default false
*/
force?: boolean;
/**
* Only when using `force` this is the fallback react node that will be used in the Suspense.
* Should warp the component with `React.Suspense`
*
* @default true
*/
suspense?: boolean;
/**
* Only when using `suspense` or `force` this is the fallback react node that will be used in the Suspense.
*/
fallback?: ReactNode;
/**
* Placeholder element props, used when the element is not visible (For setting the dimensions for example).
* Placeholder element props, used when the element is not visible (Setting the dimensions for example).
*/

@@ -27,4 +40,3 @@ placeholderProps?: AllHTMLAttributes<HTMLElement>;

*
* @param load /**
* Function that must call a dynamic import().\
* @param load Function that must call a dynamic import().\
* This must return a Promise which resolves to a module with a React component (it could be default export).

@@ -44,3 +56,3 @@ *

*/
export declare function intersectionLoader<T extends {}>(load: () => Promise<ComponentModule<T>>, { intersectionObserverOptions, force, fallback, placeholderProps }?: InteractionLoaderOptions): ComponentType<T>;
export declare function intersectionLoader<T extends {}>(load: () => Promise<ComponentModule<T>>, { intersectionObserverOptions, force, fallback, placeholderProps, suspense }?: InteractionLoaderOptions): ComponentType<T>;
//# sourceMappingURL=intersection-loader.d.ts.map

@@ -82,4 +82,3 @@ var __assign = (this && this.__assign) || function () {

*
* @param load /**
* Function that must call a dynamic import().\
* @param load Function that must call a dynamic import().\
* This must return a Promise which resolves to a module with a React component (it could be default export).

@@ -100,3 +99,3 @@ *

export function intersectionLoader(load, _a) {
var _b = _a === void 0 ? {} : _a, intersectionObserverOptions = _b.intersectionObserverOptions, force = _b.force, fallback = _b.fallback, placeholderProps = _b.placeholderProps;
var _b = _a === void 0 ? {} : _a, intersectionObserverOptions = _b.intersectionObserverOptions, force = _b.force, fallback = _b.fallback, placeholderProps = _b.placeholderProps, _c = _b.suspense, suspense = _c === void 0 ? true : _c;
return function (props) {

@@ -189,5 +188,5 @@ var _this = this;

}
return Component.current !== undefined ? (_jsx(WithSuspense, __assign({ use: force, fallback: fallback }, { children: _jsx(Component.current, __assign({}, props)) }))) : (_jsx("div", __assign({}, placeholderProps, { dangerouslySetInnerHTML: { __html: '' }, suppressHydrationWarning: true, ref: root })));
return Component.current !== undefined ? (_jsx(WithSuspense, __assign({ use: force || suspense, fallback: fallback }, { children: _jsx(Component.current, __assign({}, props)) }))) : (_jsx("div", __assign({}, placeholderProps, { dangerouslySetInnerHTML: { __html: '' }, suppressHydrationWarning: true, ref: root })));
};
}
//# sourceMappingURL=intersection-loader.js.map
{
"name": "react-intersection-loader",
"version": "0.0.4",
"version": "0.1.0",
"description": "Load react component lazily when the component is visible",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc