1+ // @flow weak
12import React , { Component } from 'react' ;
23import { Animated , ScrollView , StyleSheet , View } from 'react-native' ;
34import _ from 'lodash' ;
45
5- const SCROLLVIEW_REF = 'ScrollView' ;
6-
76const styles = StyleSheet . create ( {
87 container : {
98 flex : 1 ,
@@ -40,7 +39,10 @@ const styles = StyleSheet.create({
4039 } ,
4140} ) ;
4241
43- class ImageHeaderScrollView extends Component {
42+ class ImageHeaderScrollView extends Component < * , * , * > {
43+ container : * ;
44+ scrollViewRef : ScrollView ;
45+
4446 constructor ( props ) {
4547 super ( props ) ;
4648 this . state = {
@@ -61,7 +63,7 @@ class ImageHeaderScrollView extends Component {
6163 * with any component that expects a `ScrollView`.
6264 */
6365 getScrollResponder ( ) {
64- return this [ SCROLLVIEW_REF ] . getScrollResponder ( ) ;
66+ return this . scrollViewRef . getScrollResponder ( ) ;
6567 }
6668 getScrollableNode ( ) {
6769 return this . getScrollResponder ( ) . getScrollableNode ( ) ;
@@ -70,7 +72,7 @@ class ImageHeaderScrollView extends Component {
7072 return this . getScrollResponder ( ) . getInnerViewNode ( ) ;
7173 }
7274 setNativeProps ( props ) {
73- this [ SCROLLVIEW_REF ] . setNativeProps ( props ) ;
75+ this . scrollViewRef . setNativeProps ( props ) ;
7476 }
7577 scrollTo ( ...args ) {
7678 this . getScrollResponder ( ) . scrollTo ( ...args ) ;
@@ -187,7 +189,7 @@ class ImageHeaderScrollView extends Component {
187189 { this . renderHeader ( ) }
188190 < Animated . View style = { [ styles . container , { transform : [ { translateY : topMargin } ] } ] } >
189191 < ScrollView
190- ref = { ref => ( this [ SCROLLVIEW_REF ] = ref ) }
192+ ref = { ref => ( this . scrollViewRef = ref ) }
191193 style = { styles . container }
192194 scrollEventThrottle = { 16 }
193195 onScroll = { Animated . event ( [
@@ -208,8 +210,8 @@ class ImageHeaderScrollView extends Component {
208210}
209211
210212ImageHeaderScrollView . propTypes = {
211- children : React . PropTypes . node || React . PropTypes . nodes ,
212- childrenStyle : View . propTypes . style ,
213+ children : React . PropTypes . node || React . PropTypes . arrayOf ( React . PropTypes . node ) ,
214+ childrenStyle : React . PropTypes . any ,
213215 overlayColor : React . PropTypes . string ,
214216 fadeOutForeground : React . PropTypes . bool ,
215217 foregroundParallaxRatio : React . PropTypes . number ,
0 commit comments