Socket
Socket
Sign inDemoInstall

@tjoskar/react-lazyload-img

Package Overview
Dependencies
5
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

7

package.json

@@ -5,3 +5,3 @@ {

"description": "Lazy image loader for react",
"version": "1.0.1",
"version": "1.0.2",
"scripts": {

@@ -16,5 +16,3 @@ "test": "jest",

},
"dependencies": {
"simple-spy": "^2.2.1"
},
"dependencies": {},
"devDependencies": {

@@ -27,2 +25,3 @@ "@types/jest": "^22.2.3",

"react-dom": "^16.3.1",
"simple-spy": "^2.2.1",
"ts-jest": "^22.4.3",

@@ -29,0 +28,0 @@ "typescript": "2.8.1"

@@ -16,8 +16,8 @@ # react-lazyload-img [![Build Status](https://travis-ci.org/tjoskar/react-lazyload-img.svg?branch=master)](https://travis-ci.org/tjoskar/react-lazyload-img) [![codecov](https://codecov.io/gh/tjoskar/react-lazyload-img/branch/master/graph/badge.svg)](https://codecov.io/gh/tjoskar/react-lazyload-img)

```jsx
import React, { Component } from 'react';
import { LazyLoadImage, LazyLoadBackgroundImage } from './lazy-load-image'
import React, { Component } from 'react'
import { LazyLoadImage, LazyLoadBackgroundImage } from '@tjoskar/react-lazyload-img'
class App extends Component {
defaultImage = 'https://www.placecage.com/1000/1000';
image = 'https://images.unsplash.com/photo-1443890923422-7819ed4101c0?fm=jpg';
defaultImage = 'https://www.placecage.com/1000/1000'
image = 'https://images.unsplash.com/photo-1443890923422-7819ed4101c0?fm=jpg'

@@ -27,9 +27,9 @@ render() {

<React.Fragment>
{ /* To use img-tag */ }
{ /* To use a img-tag */ }
<LazyLoadImage width="50" height="200px" defaultImage={this.defaultImage} image={this.image} />
{ /* To use div-tag with background image styling */ }
{ /* To use a div-tag with background image styling */ }
<LazyLoadBackgroundImage width="100%" height="200px" defaultImage={this.defaultImage} image={this.image} />
</React.Fragment>
);
)
}

@@ -41,2 +41,4 @@ }

See: https://stackblitz.com/edit/react-lazy-load-image for examples
## Props

@@ -59,3 +61,3 @@

The browser you are targeting needs to have support for `IntersectionObserver` and `WeakMap` or import polyfill for them. You also need to use a bundler that understand es-mudules (eg. webpack, rollup, parcel, fusebox, etc.)
The browser you are targeting needs to have support for `IntersectionObserver` and `WeakMap` or you need to import polyfill for them. You also need to use a bundler that understand es-modules (eg. webpack, rollup, parcel, fusebox, etc.)

@@ -62,0 +64,0 @@ ## License

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc