lazy-react 2.2.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/demo/demo.js CHANGED
@@ -3,18 +3,8 @@ import ReactDOM from 'react-dom'
3
3
  import {LazyImage, LazyBackgroundImage, LazyFrame, LazyComponent} from '../dist'
4
4
 
5
5
 
6
- class Experimental extends Component {
7
- constructor(props){
8
- super(props)
9
- }
10
-
11
- componentDidMount(){
12
- console.log('now I\'m loaded')
13
- }
14
-
15
- render(){
16
- return <h1> I'm lazy loaded !</h1>
17
- }
6
+ function Experimental (props){
7
+ return <h1> I'm lazy loaded!</h1>
18
8
  }
19
9
 
20
10
  class Demo extends Component {
@@ -26,61 +16,54 @@ class Demo extends Component {
26
16
  let style = {
27
17
  minHeight:'100vh'
28
18
  }
29
- return <div>
30
- <h2>Just scroll</h2>
31
- <div style={{
32
- minHeight:'100vh',
33
- minWidth:'100vw',
34
- backgroundColor:'tomato'
35
- }}></div>
36
- <LazyImage
37
- link={'https://images.unsplash.com/photo-1462834026679-7c03bf571a67?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&s=6e160dc1e65511df7bf1c461f8a93c82'}
38
- offset={0}
39
- // style={style}
40
- />
41
- <LazyImage
42
- link={'https://images.unsplash.com/5/unsplash-kitsune-4.jpg?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&s=44828cfc286e8eb8cd0ed2ca561f8cb9'}
19
+ return <div>
20
+ <h2>Just scroll</h2>
21
+ <div style={{
22
+ minHeight: '100vh',
23
+ minWidth: '100vw',
24
+ backgroundColor: 'tomato'
25
+ }}></div>
26
+ <LazyImage
27
+ link={'https://images.unsplash.com/photo-1462834026679-7c03bf571a67?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&s=6e160dc1e65511df7bf1c461f8a93c82'}
28
+ offset={0}
29
+ />
30
+ <LazyImage
31
+ link={'https://images.unsplash.com/5/unsplash-kitsune-4.jpg?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&s=44828cfc286e8eb8cd0ed2ca561f8cb9'}
43
32
  offset={100}
44
33
  className={'styledImage'}
45
- // style={style}
46
- />
47
- <LazyImage
48
- link={'https://images.unsplash.com/photo-1472132858735-6313c7962473?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&s=f38318ed6adee6db020705bedf6d6e10'}
34
+ />
35
+ <LazyImage
36
+ link={'https://images.unsplash.com/photo-1472132858735-6313c7962473?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&s=f38318ed6adee6db020705bedf6d6e10'}
49
37
  offset={100}
50
- // style={style}
51
- />
52
- <LazyImage
53
- link={'https://images.unsplash.com/photo-1469899324414-c72bfb4d4161?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&s=8d708d646e3b2d32c5faf67e01919872'}
38
+ />
39
+ <LazyImage
40
+ link={'https://images.unsplash.com/photo-1469899324414-c72bfb4d4161?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&s=8d708d646e3b2d32c5faf67e01919872'}
54
41
  offset={100}
55
42
  className={'test'}
56
43
  preserveAspect={false}
57
- // style={style}
58
- />
59
- <LazyImage
60
- link={'https://images.unsplash.com/photo-1462834026679-7c03bf571a67?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&s=6e160dc1e65511df7bf1c461f8a93c82'}
44
+ />
45
+ <LazyImage
46
+ link={'https://images.unsplash.com/photo-1462834026679-7c03bf571a67?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&s=6e160dc1e65511df7bf1c461f8a93c82'}
61
47
  offset={100}
62
48
  className={'test'}
63
49
  preserveAspect={false}
64
- // style={style}
65
- />
66
- <LazyBackgroundImage
67
- link={'https://images.unsplash.com/photo-1462834026679-7c03bf571a67?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&s=6e160dc1e65511df7bf1c461f8a93c82'}
68
- className="fill"
69
- // style={style}
70
- />
50
+ />
51
+ <LazyBackgroundImage
52
+ link={'https://images.unsplash.com/photo-1462834026679-7c03bf571a67?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&s=6e160dc1e65511df7bf1c461f8a93c82'}
53
+ className="fill"
54
+ />
71
55
 
72
- <LazyComponent>
73
- <Experimental/>
74
- <Experimental/>
75
- <Experimental/>
76
- </LazyComponent>
56
+ <LazyComponent>
57
+ <Experimental />
58
+ <Experimental />
59
+ <Experimental />
60
+ </LazyComponent>
77
61
 
78
- <LazyFrame
79
- link={'http://jonathanobino.xyz'}
80
- scrolling={true}
81
- // style={style}
82
- />
83
- </div>
62
+ <LazyFrame
63
+ link={'http://jonathanobino.xyz'}
64
+ scrolling={'true'}
65
+ />
66
+ </div>
84
67
  }
85
68
  }
86
69