react-debounce-iframe
A react iframe component which allows you to reduce the src updating frequency.
In the following example, it will only issue requests to 1.html
and 5.html
(Demo).
import Iframe from 'react-debounce-iframe'; { ; thisstate = src: '1.html'; } { ; ; ; ; } { return <Iframe = =/> // Only issue requests to 1.html and 5.html. ; }
Install
NPM
npm install --save react-debounce-iframe
Yarn
yarn add react-debounce-iframe
Usage
import Iframe from 'react-debounce-iframe'; { <Iframe = = // = = /> }
Properties
Property | Type | Default | Description |
---|---|---|---|
src | string | undefined | iframe src |
debounceWait | number | 0 | Debouncing time in millionseconds |
onDebounceStart | func | undefined | Triggered when debouncing starts |
onDebounceEnd | func | undefined | Triggered when debouncing stops |