-
Notifications
You must be signed in to change notification settings - Fork 171
Description
Bug description:
`import { Dimensions } from 'react-native';
import AutoHeightWebView from 'react-native-autoheight-webview';
import { SafeHTMLTypes } from '../../types/CommonTypes';
const SafeHTMLComponent = ({ htmlContent = '', customStyles = '' }: SafeHTMLTypes) => {
if (!htmlContent && !Dimensions?.get('window')?.width) {
return null;
}
return (
<AutoHeightWebView
style={{ width: Dimensions.get('window').width }}
customStyle={
customStyles ||
`
body {
font-size: 16px;
line-height: 1.5;
color: #333;
}
p {
margin: 0 0 10px 0;
}
ul {
padding-left: 20px;
}
li {
margin-bottom: 10px;
}
img {
max-width: 100%;
height: auto;
}
`
}
files={[
{
href: 'cssfileaddress',
type: 'text/css',
rel: 'stylesheet',
},
]}
source={{ html: htmlContent }}
viewportContent="width=device-width, user-scalable=no"
/>
);
};
export default SafeHTMLComponent;`
The above is my code, and it returns this error,
ERROR Warning: ForwardRef: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.
and I checked by returning just a text and then there is no error displays and I logged the params before returning the null and I can clearly see values in props even before reaching the return null, which means the component is only rendering with correct props values.
Which clears that the issue is only with the package.
To Reproduce:
Source (static HTML or url):
Expected behavior:
Screenshots/Videos:
Environment:
- OS: Android/iOS
- OS version: 15
- react-native version: 0.76.5,
- react-native-webview version: 13.13.1,
- react-native-autoheight-webview version: 1.6.5,