Simple lazy loading component built with react
npm install react-lazy-loadReact Lazy Load Component
=========================
React Lazy Load is an easy-to-use React component which helps you defer loading content in predictable way. It's fast, You can also use component inside scrolling container, such as div with scrollbar. It will be found automatically. Check out an example.


offset={'0px 10px 200px 0px'} or offset={100}
npm i -S react-lazy-load
`
Examples
* In Repo
Examples
$3
`jsx
import React from 'react';
import LazyLoad from 'react-lazy-load';
const MyComponent = () => (
)
`
$3
`jsx
const MyComponent = () => (
)
`
$3
`jsx
const MyComponent = () => (
)
`
$3
`jsx
const MyComponent = () => (
{console.log('loaded!')}}>
)
`
$3
There are two primary classes you an use to control the component LazyLoad and is-visible
`css
/ Example of how to fade our content in /
.LazyLoad {
opacity: 0;
transition: all 1s ease-in-out;
}
.is-visible {
opacity: 1;
}
`
Props
#### offset
Type: Number|String Default: 0
The offset option allows you to specify how far below, above, to the left, and to the right of the viewport you want to _begin_ displaying your content. If you specify 0, your content will be displayed as soon as it is visible in the viewport, if you want to load _1000px_ below or above the viewport, use 1000.
#### threshold
Type: Number Default: 0
This threshold option allows you to specify how much of the element must be shown on the screen prior to loading. This requires a _width_ and _height_ to be set on the component in order for the browser to calcualte the viewable area.
#### height
Type: String|Number
The height option allows you to set the element's height even when it has no content.
#### width
Type: String|Number
The width option allows you to set the element's width even when it has no content.
#### onContentVisible
Type Function
A callback function to execute when the content appears on the screen.
Building LazyLoad
`
npm run build
`
Running examples
`
cd examples/basic
npm run dev
``