jsdf / react-native-htmlview

A React Native component which renders HTML content as native views
ISC License
2.71k stars 467 forks source link

import ViewPropTypes from deprecated-react-native-prop-types instead of react-native #345

Open ThirupathaiahR opened 2 years ago

ThirupathaiahR commented 2 years ago

In HTMLView.js import ViewPropTypes from deprecated-react-native-prop-types instead of react-native

Please update

jplandry908 commented 2 years ago

Add deprecated-react-native-prop-types change ViewPropTypes #346

khelifioussama commented 2 years ago

@jsdf

leofolive commented 2 years ago

@jplandry908 @khelifioussama

The patch solved my problem, I recommend that you use the patch and don't wait for updates on that lib.

react-native-htmlview+0.16.0.patch

diff --git a/node_modules/react-native-htmlview/HTMLView.js b/node_modules/react-native-htmlview/HTMLView.js
index 43f8b7e..8e4c9f7 100644
--- a/node_modules/react-native-htmlview/HTMLView.js
+++ b/node_modules/react-native-htmlview/HTMLView.js
@@ -1,8 +1,8 @@
 import React, {PureComponent} from 'react';
 import PropTypes from 'prop-types';
 import htmlToElement from './htmlToElement';
-import {Linking, Platform, StyleSheet, View, ViewPropTypes} from 'react-native';
-
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';
+import {Linking, Platform, StyleSheet, View} from 'react-native';
 const boldStyle = {fontWeight: 'bold'};
 const italicStyle = {fontStyle: 'italic'};
 const underlineStyle = {textDecorationLine: 'underline'};

Your project must depend on (deprecated-react-native-prop-types) for the patch to work, besides having a postinstall-postinstall lib and patch-package configured.

Another alternative is a fork of this lib and generate your own version with this fix.

jplandry908 commented 2 years ago

Thanks @LFMAKER. I ended up swapping over to 'react-native-render-html' in my project which is more recently maintained. The change was fairly easy within my codebase. However, I appreciate you bringing the patch to my attention.

kusaasira commented 2 years ago

@LFMAKER did you delete the patch?