From 47839fa89843df4f51eeb39dcbf5e331a40fd75f Mon Sep 17 00:00:00 2001 From: Linden Darling Date: Tue, 28 Nov 2017 15:30:48 +1100 Subject: [PATCH] Refactor PropTypes and move from View.propTypes to ViewPropTypes due to deprecated APIs breaking from RN 0.49 on; Update README to state new minimum RN version for lib; this fixes https://github.com/react-native-component/react-native-smart-badge/issues/5 --- Badge.js | 11 +++++------ README.md | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Badge.js b/Badge.js index ffb93d8..1f00ddb 100644 --- a/Badge.js +++ b/Badge.js @@ -5,14 +5,13 @@ * Copyright (c) 2016 react-native-component */ -import React, { - Component, - PropTypes, -} from 'react' +import React, { Component } from 'react'; +import { PropTypes } from 'prop-types'; import { View, Text, StyleSheet, + ViewPropTypes } from 'react-native' const styles = StyleSheet.create({ @@ -45,7 +44,7 @@ export default class Badge extends Component { static propTypes = { //borderRadius: PropTypes.number, //number 18, null 5 extraPaddingHorizontal: PropTypes.number, - style: View.propTypes.style, + style: ViewPropTypes.style, textStyle: Text.propTypes.style, minHeight: PropTypes.number, minWidth: PropTypes.number, @@ -104,4 +103,4 @@ export default class Badge extends Component { }); } -} \ No newline at end of file +} diff --git a/README.md b/README.md index 5615e43..bffbb7b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A smart autofit badge for react-native apps, written in JS for cross-platform support. It works on iOS and Android. -This component is compatible with React Native 0.25 and newer. +This component is compatible with React Native 0.49 and newer. ## Preview