From 50d9b3454ac5735274e722b510564f86f3ebc11a Mon Sep 17 00:00:00 2001 From: EdsonPaulo Date: Thu, 19 Jan 2023 14:02:10 +0100 Subject: [PATCH] fix: :bug: ViewPropTypes has been removed from React Native --- index.js | 7 ++++--- package.json | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 7fb0df3..5143ee2 100755 --- a/index.js +++ b/index.js @@ -7,7 +7,7 @@ * @flow */ -import React, {Component} from 'react'; +import React, { Component } from 'react'; import { StyleSheet, View, @@ -16,9 +16,10 @@ import { TouchableHighlight, ViewPropTypes as RNViewPropTypes, } from 'react-native'; +import { ViewPropTypes as DeprecatedViewPropTypes } from 'deprecated-react-native-prop-types' import PropTypes from 'prop-types'; -const ViewPropTypes = RNViewPropTypes || View.propTypes; +const ViewPropTypes = DeprecatedViewPropTypes || RNViewPropTypes || View.propTypes; export default class CheckBox extends Component { constructor(props) { @@ -111,7 +112,7 @@ export default class CheckBox extends Component { } return ( - + ); } diff --git a/package.json b/package.json index e1406ec..95979ff 100755 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "url": "https://github.com/crazycodeboy/react-native-check-box/issues" }, "dependencies": { - "prop-types": "^15.5.7" + "prop-types": "^15.5.7", + "deprecated-react-native-prop-types": "^4.0.0" }, "peerDependencies": { "react-native": ">=0.20.0"