File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ class ParallaxScrollView extends Component {
39
39
console . error ( 'Property `stickyHeaderHeight` must be set if `renderStickyHeader` is used' )
40
40
}
41
41
this . state = { scrollY : new Animated . Value ( 0 ) } ;
42
- this . _footerComponent = null ;
42
+ this . _footerComponent = { setNativeProps ( ) { } } ; // Initial stub
43
43
this . _footerHeight = 0 ;
44
44
this . _animatedEvent = Animated . event ( [ { nativeEvent : { contentOffset : { y : this . state . scrollY } } } ] ) ;
45
45
}
@@ -154,7 +154,7 @@ class ParallaxScrollView extends Component {
154
154
} ]
155
155
} ] } >
156
156
< View >
157
- { renderBackground && renderBackground ( ) }
157
+ { renderBackground ( ) }
158
158
</ View >
159
159
</ Animated . View >
160
160
) ;
@@ -177,7 +177,7 @@ class ParallaxScrollView extends Component {
177
177
extrapolate : 'extend'
178
178
} )
179
179
} ] } >
180
- { renderParallaxHeader && renderParallaxHeader ( ) }
180
+ { renderParallaxHeader ( ) }
181
181
</ Animated . View >
182
182
</ View >
183
183
) ;
@@ -247,6 +247,8 @@ class ParallaxScrollView extends Component {
247
247
ParallaxScrollView . propTypes = IPropTypes ;
248
248
249
249
ParallaxScrollView . defaultProps = {
250
+ renderBackground : ( ) => < View /> ,
251
+ renderParallaxHeader : ( ) => < View /> ,
250
252
headerBackgroundColor : '#000' ,
251
253
contentBackgroundColor : '#fff' ,
252
254
onChangeHeaderVisibility : ( ) => { } ,
You can’t perform that action at this time.
0 commit comments