Skip to content

Commit a736832

Browse files
committed
React.PropTypes改为PropTypes
1 parent c88e68f commit a736832

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

index.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import {
1515
Text,
1616
} from 'react-native'
1717

18+
import PropTypes from 'prop-types';
19+
1820
export const DURATION = {
1921
LENGTH_LONG: 2000,
2022
LENGTH_SHORT: 500,
@@ -129,17 +131,17 @@ const styles = StyleSheet.create({
129131
});
130132

131133
Toast.propTypes = {
132-
style: View.propTypes.style,
133-
position: React.PropTypes.oneOf([
134+
style: PropTypes.object,
135+
position: PropTypes.oneOf([
134136
'top',
135137
'center',
136138
'bottom',
137139
]),
138-
textStyle: Text.propTypes.style,
139-
positionValue: React.PropTypes.number,
140-
fadeInDuration: React.PropTypes.number,
141-
fadeOutDuration: React.PropTypes.number,
142-
opacity: React.PropTypes.number
140+
textStyle: PropTypes.object,
141+
positionValue: PropTypes.number,
142+
fadeInDuration: PropTypes.number,
143+
fadeOutDuration: PropTypes.number,
144+
opacity: PropTypes.number
143145
}
144146

145147
Toast.defaultProps = {

0 commit comments

Comments
 (0)