File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react' ;
2
- // import PropTypes from 'prop-types';
3
2
import { ParallaxProvider } from 'react-scroll-parallax' ;
4
3
import { ParallaxTest } from 'components' ;
5
4
6
5
export default class App extends Component {
6
+ // this just serves to test unmount/re-mount ParallaxProvider
7
+ state = {
8
+ mount : true ,
9
+ } ;
10
+
7
11
render ( ) {
8
12
return (
9
- < ParallaxProvider >
10
- < ParallaxTest />
11
- </ ParallaxProvider >
13
+ < main >
14
+ { this . state . mount ? (
15
+ < ParallaxProvider >
16
+ < ParallaxTest />
17
+ </ ParallaxProvider >
18
+ ) : (
19
+ < div />
20
+ ) }
21
+ </ main >
12
22
) ;
13
23
}
14
24
}
Original file line number Diff line number Diff line change @@ -389,6 +389,7 @@ function ParallaxController() {
389
389
this . destroy = function ( ) {
390
390
_removeListeners ( ) ;
391
391
_removeParallaxStyles ( ) ;
392
+ window . ParallaxController = null ;
392
393
} ;
393
394
}
394
395
You can’t perform that action at this time.
0 commit comments