@@ -4,7 +4,6 @@ import ReactDom from 'react-dom';
4
4
import expect from 'expect.js' ;
5
5
import TestUtils from 'react-dom/test-utils' ;
6
6
import ticker from 'rc-tween-one/lib/ticker' ;
7
-
8
7
import ScrollAnim from '../index' ;
9
8
10
9
const windowHeight = 500 ;
@@ -14,23 +13,25 @@ const endHeight = startHeight + windowHeight;
14
13
describe ( 'rc-scroll-anim' , ( ) => {
15
14
let div ;
16
15
let instance ;
17
- function createScrollParallax ( cProps ) {
18
- function ParallaxDemo ( props ) {
19
- return ( < div
20
- style = { { height : 500 , overflow : 'scroll' , position : 'absolute' , width : '100%' , top : 0 } }
21
- id = "c-div"
22
- >
23
- < div style = { { height : 1000 } } />
24
- < div style = { { height : 1000 } } >
16
+ function createScrollParallax ( props ) {
17
+ class ParallaxDemo extends React . PureComponent {
18
+ render ( ) {
19
+ return ( < div
20
+ style = { { height : 500 , overflow : 'scroll' , position : 'absolute' , width : '100%' , top : 0 } }
21
+ id = "c-div"
22
+ >
23
+ < div style = { { height : 1000 } } />
24
+ < div style = { { height : 1000 } } >
25
25
-------------
26
- < ScrollAnim . Parallax { ...props } targetId = "c-div" >
26
+ < ScrollAnim . Parallax { ... this . props } targetId = "c-div" >
27
27
demo
28
- </ ScrollAnim . Parallax >
28
+ </ ScrollAnim . Parallax >
29
29
-------------
30
- </ div >
31
- </ div > ) ;
30
+ </ div >
31
+ </ div > ) ;
32
+ }
32
33
}
33
- return ReactDom . render ( < ParallaxDemo { ...cProps } /> , div ) ;
34
+ return ReactDom . render ( < ParallaxDemo { ...props } /> , div ) ;
34
35
}
35
36
36
37
beforeEach ( ( ) => {
@@ -103,4 +104,4 @@ describe('rc-scroll-anim', () => {
103
104
} , 350 ) ;
104
105
} , 350 ) ;
105
106
} ) ;
106
- } ) ;
107
+ } ) ;
0 commit comments