Skip to content

Commit b773058

Browse files
author
Bruno Cascio
committed
Updated for React 16 compatibility
1 parent 31f85ad commit b773058

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
"test": "npm run lint && flow",
99
"prettify": "prettier --single-quote --trailing-comma es5 --print-width 100 --write src/**.js"
1010
},
11-
"files": ["README.md", "LICENCE", "src", "readmeAssets"],
11+
"files": [
12+
"README.md",
13+
"LICENCE",
14+
"src",
15+
"readmeAssets"
16+
],
1217
"repository": {
1318
"type": "git",
1419
"url": "git+https://github.com/bamlab/react-native-image-header-scroll-view.git"
@@ -48,6 +53,7 @@
4853
"react-native": ">=0.20.0"
4954
},
5055
"dependencies": {
51-
"lodash": "^4.17.4"
56+
"lodash": "^4.17.4",
57+
"prop-types": "^15.5.10"
5258
}
5359
}

src/ImageHeaderScrollView.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @flow
22
import React, { Component } from 'react';
3+
import PropTypes from 'prop-types';
34
import { Animated, ScrollView, StyleSheet, View } from 'react-native';
45
import _ from 'lodash';
56

@@ -234,8 +235,8 @@ class ImageHeaderScrollView extends Component<DefaultProps, Props, State> {
234235
}
235236

236237
ImageHeaderScrollView.childContextTypes = {
237-
scrollY: React.PropTypes.instanceOf(Animated.Value),
238-
scrollPageY: React.PropTypes.number,
238+
scrollY: PropTypes.instanceOf(Animated.Value),
239+
scrollPageY: PropTypes.number,
239240
};
240241

241242
const styles = StyleSheet.create({

src/TriggeringView.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @flow weak
22
import React, { Component } from 'react';
3+
import PropTypes from 'prop-types';
34
import { View, Animated } from 'react-native';
45
import _ from 'lodash';
56

@@ -89,12 +90,12 @@ class TriggeringView extends Component<*, *, *> {
8990
}
9091
}
9192
TriggeringView.propTypes = {
92-
onBeginHidden: React.PropTypes.func,
93-
onHide: React.PropTypes.func,
94-
onBeginDisplayed: React.PropTypes.func,
95-
onDisplay: React.PropTypes.func,
96-
onTouchTop: React.PropTypes.func,
97-
onTouchBottom: React.PropTypes.func,
93+
onBeginHidden: PropTypes.func,
94+
onHide: PropTypes.func,
95+
onBeginDisplayed: PropTypes.func,
96+
onDisplay: PropTypes.func,
97+
onTouchTop: PropTypes.func,
98+
onTouchBottom: PropTypes.func,
9899
};
99100

100101
TriggeringView.defaultProps = {
@@ -107,8 +108,8 @@ TriggeringView.defaultProps = {
107108
};
108109

109110
TriggeringView.contextTypes = {
110-
scrollY: React.PropTypes.instanceOf(Animated.Value),
111-
scrollPageY: React.PropTypes.number,
111+
scrollY: PropTypes.instanceOf(Animated.Value),
112+
scrollPageY: PropTypes.number,
112113
};
113114

114115
export default TriggeringView;

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1400,7 +1400,7 @@ promise@^7.1.1:
14001400
dependencies:
14011401
asap "~2.0.3"
14021402

1403-
prop-types@^15.5.6:
1403+
prop-types@^15.5.10, prop-types@^15.5.6:
14041404
version "15.5.10"
14051405
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154"
14061406
dependencies:

0 commit comments

Comments
 (0)