Skip to content

Commit 8ec2eaf

Browse files
committed
View.propTypes fix
1 parent 1b038f9 commit 8ec2eaf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/ButtonComponent.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
3-
import { StyleSheet, View, TouchableOpacity } from 'react-native';
3+
import { StyleSheet, View, TouchableOpacity, ViewPropTypes } from 'react-native';
44
import LinearGradient from 'react-native-linear-gradient';
55
import Button from './common/Button';
66

7+
const RNViewPropTypes = ViewPropTypes || View.propTypes;
8+
79
const propTypes = {
810
...Button.propTypes,
911
width: PropTypes.number,
@@ -18,7 +20,7 @@ const propTypes = {
1820
disabled: PropTypes.bool,
1921
backgroundColors: PropTypes.array,
2022
buttonStyle: PropTypes.any,
21-
style: PropTypes.any,
23+
style: RNViewPropTypes.style,
2224
progressSize: PropTypes.number,
2325
onPress: PropTypes.func,
2426

0 commit comments

Comments
 (0)