Skip to content

Commit 46b8203

Browse files
authored
Merge pull request ttdung11t2#3 from PaitoAnderson/master
Fix for React Native 44+
2 parents 4237663 + c3440d9 commit 46b8203

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

components/ConfirmationCodeInput.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import React, {Component} from 'react';
22
import PropTypes from 'prop-types';
3-
import { View, TextInput, StyleSheet, Dimensions } from 'react-native';
3+
import { View, TextInput, StyleSheet, Dimensions, ViewPropTypes } from 'react-native';
44
import _ from 'lodash';
55

6+
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
7+
const viewPropTypes = ViewPropTypes || View.propTypes;
8+
69
export default class ConfirmationCodeInput extends Component {
710
static propTypes = {
811
codeLength: PropTypes.number,
@@ -17,7 +20,7 @@ export default class ConfirmationCodeInput extends Component {
1720
ignoreCase: PropTypes.bool,
1821
autoFocus: PropTypes.bool,
1922
codeInputStyle: TextInput.propTypes.style,
20-
containerStyle: View.propTypes.style,
23+
containerStyle: viewPropTypes.style,
2124
onFulfill: PropTypes.func,
2225
};
2326

@@ -290,4 +293,4 @@ const styles = StyleSheet.create({
290293
textAlign: 'center',
291294
padding: 0
292295
}
293-
});
296+
});

0 commit comments

Comments
 (0)