@tjoskar/react-lazyload-img
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -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 |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2
63
0
14890
9
14
189
- Removedsimple-spy@^2.2.1
- Removedsimple-spy@2.2.1(transitive)