Skip to content

Commit 1c97039

Browse files
authored
Merge pull request #13 from alphasp/master
Migrate deprecated View.propTypes and React.PropTypes
2 parents 8ad6eda + 73d410b commit 1c97039

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
*/
88

99
import React, {Component} from 'react';
10+
import PropTypes from 'prop-types';
1011
import {
1112
StyleSheet,
1213
View,
1314
Animated,
1415
Dimensions,
1516
Text,
17+
ViewPropTypes as RNViewPropTypes,
1618
} from 'react-native'
19+
20+
const ViewPropTypes = RNViewPropTypes || View.propTypes;
1721
import {PropTypes} from 'prop-types';
1822
export const DURATION = {
1923
LENGTH_LONG: 2000,
@@ -129,8 +133,8 @@ const styles = StyleSheet.create({
129133
});
130134

131135
Toast.propTypes = {
132-
style: View.propTypes.style,
133-
position:PropTypes.oneOf([
136+
style: ViewPropTypes.style,
137+
position: PropTypes.oneOf([
134138
'top',
135139
'center',
136140
'bottom',

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@
3131
"react-native": ">=0.20.0",
3232
"prop-types": "^15.5.7"
3333
},
34-
"homepage": "https://github.com/crazycodeboy/react-native-easy-toast#readme"
34+
"homepage": "https://github.com/crazycodeboy/react-native-easy-toast#readme",
35+
"dependencies": {
36+
"prop-types": "^15.5.10"
37+
}
3538
}

0 commit comments

Comments
 (0)