diff --git a/examples/index.html b/examples/index.html index 1e68f45..7d08ee3 100644 --- a/examples/index.html +++ b/examples/index.html @@ -41,9 +41,7 @@

Basic Example with error message

- - - - + + diff --git a/examples/src/Examples.js b/examples/src/Examples.js index c1a054b..f20884b 100644 --- a/examples/src/Examples.js +++ b/examples/src/Examples.js @@ -1,5 +1,5 @@ import React from 'react'; -import Preload from 'react-preload'; +import Preload from '../../modules/index'; import Spinner from './Spinner'; const imgBase = 'https://picsum.photos/800/600?'; @@ -28,6 +28,11 @@ export class Example1 extends React.Component { }) } + _getProgress = (completedCount, total) => { + const percent = (Math.round(completedCount/total * 10000)/100).toFixed(2) + '%' + console.log(percent); + } + render() { const images = [ `${imgBase}text=1-${this.state.cacheBreaker}`, @@ -38,7 +43,7 @@ export class Example1 extends React.Component { return (
-