jsdf / react-native-htmlview

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

ViewPropTypes will be removed from 'react-native' #358

Open Zeeshan404 opened 1 year ago

Zeeshan404 commented 1 year ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Here is the diff that solved my problem:

node_modules/react-native-htmlview/HTMLView.js
 import React, {PureComponent} from 'react';
 import PropTypes from 'prop-types';
 import htmlToElement from './htmlToElement';
-import {Linking, Platform, StyleSheet, View, ViewPropTypes} from 'react-native';
+import {Linking, Platform, StyleSheet, View } from 'react-native';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types'

 const boldStyle = {fontWeight: 'bold'};
 const italicStyle = {fontStyle: 'italic'};
hfarhanahmed commented 1 year ago

@Zeeshan404 This Library is not updated for years. I forked this and resolved the issue myself and used it.

nobady90 commented 1 year ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Here is the diff that solved my problem:

node_modules/react-native-htmlview/HTMLView.js
 import React, {PureComponent} from 'react';
 import PropTypes from 'prop-types';
 import htmlToElement from './htmlToElement';
-import {Linking, Platform, StyleSheet, View, ViewPropTypes} from 'react-native';
+import {Linking, Platform, StyleSheet, View } from 'react-native';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types'

 const boldStyle = {fontWeight: 'bold'};
 const italicStyle = {fontStyle: 'italic'};

a quick solution could be to use the patch-package after modifying the part reported by @Zeeshan404.