jsdf/react-native-htmlview

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

ThirupathaiahR opened this issue · 5 comments

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

Please update

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

@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.

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.

@LFMAKER did you delete the patch?