@@ -5,8 +5,8 @@ import { Animated, ScrollView, StyleSheet, View } from 'react-native';
5
5
import _ from 'lodash' ;
6
6
7
7
export type Props = {
8
- children : React$Element < any > ,
9
- childrenStyle : any ,
8
+ children ?: ? React$Element < any > ,
9
+ childrenStyle ?: ? any ,
10
10
overlayColor : string ,
11
11
fadeOutForeground : boolean ,
12
12
foregroundParallaxRatio : number ,
@@ -17,7 +17,7 @@ export type Props = {
17
17
renderFixedForeground : ( ) => React$Element < any > ,
18
18
renderForeground : ( ) => React$Element < any > ,
19
19
renderHeader : ( ) => React$Element < any > ,
20
- renderTouchableFixedForeground : ( ) => React$Element < any > ,
20
+ renderTouchableFixedForeground ?: ? ( ) => React$Element < any > ,
21
21
} ;
22
22
23
23
export type DefaultProps = {
@@ -172,10 +172,6 @@ class ImageHeaderScrollView extends Component<Props, State> {
172
172
}
173
173
174
174
renderTouchableFixedForeground ( ) {
175
- if ( ! this . props . renderTouchableFixedForeground ) {
176
- return < View /> ;
177
- }
178
-
179
175
const height = this . interpolateOnImageHeight ( [ this . props . maxHeight , this . props . minHeight ] ) ;
180
176
181
177
const headerScale = this . state . scrollY . interpolate ( {
@@ -189,6 +185,10 @@ class ImageHeaderScrollView extends Component<Props, State> {
189
185
transform : [ { scale : headerScale } ] ,
190
186
} ;
191
187
188
+ if ( ! this . props . renderTouchableFixedForeground ) {
189
+ return < View /> ;
190
+ }
191
+
192
192
return (
193
193
< Animated . View style = { [ styles . header , styles . touchableFixedForeground , headerTransformStyle ] } >
194
194
{ this . props . renderTouchableFixedForeground ( ) }
0 commit comments