From 46ee60e8970f61a0137d80d8b24159434c9579fc Mon Sep 17 00:00:00 2001 From: Yadigar Zengin Date: Wed, 28 Sep 2022 12:55:09 +0200 Subject: [PATCH] fix: small deprecation issue --- index.js | 5 +++-- package.json | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index e15cc90..d154922 100644 --- a/index.js +++ b/index.js @@ -2,14 +2,15 @@ import React from 'react'; import {Text} from 'react-native'; import {findAll} from 'highlight-words-core'; import PropTypes from 'prop-types'; +import { TextPropTypes } from 'deprecated-react-native-prop-types' Highlighter.propTypes = { autoEscape: PropTypes.bool, - highlightStyle: Text.propTypes.style, + highlightStyle: TextPropTypes ? TextPropTypes.style : Text.propTypes?.style, searchWords: PropTypes.arrayOf(PropTypes.string).isRequired, textToHighlight: PropTypes.string.isRequired, sanitize: PropTypes.func, - style: Text.propTypes.style + style: TextPropTypes ? TextPropTypes.style : Text.propTypes?.style }; /** diff --git a/package.json b/package.json index 8d99126..6281fa7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-highlight-words", - "version": "1.0.1", + "version": "1.0.2", "description": "A React Native port of react-highlight-words. This component is used to highlight words within a larger body of text.", "main": "index.js", "scripts": { @@ -31,6 +31,7 @@ }, "homepage": "https://github.com/clauderic/react-native-highlight-words", "dependencies": { + "deprecated-react-native-prop-types": "^2.3.0", "highlight-words-core": "^1.0.3", "prop-types": "^15.5.7" },