A React Native component that displays HTML in a UIWebView with optional sanitization and auto-height adjustment.
react-native-html-webview is a React Native component that displays HTML content using a native UIWebView. It addresses the need to safely render untrusted HTML in mobile apps by integrating sanitization to remove JavaScript and unsafe elements, preventing security vulnerabilities.
React Native developers building iOS apps that need to display user-generated HTML, external web content, or formatted text with security considerations.
It offers a secure and native HTML rendering solution with auto-height adjustment and link handling, distinguishing itself from alternatives that convert HTML to React Native views by using UIWebView for full HTML support.
Display HTML in a UIWebView, optionally sanitizing it first
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Integrates the safe-html library with a whitelist to strip JavaScript and unsafe elements, providing a robust defense against XSS attacks in untrusted HTML.
Dynamically adjusts the WebView height to match content and disables scrolling, ensuring a seamless UI without manual size calculations.
Uses native UIWebView for rendering, supporting complex HTML that alternatives converting to React Native views might not handle correctly.
Offers an onLink callback to capture user clicks on hyperlinks, enabling custom navigation logic or actions based on link hrefs.
Built on UIWebView, it's incompatible with Android, restricting its use to iOS-only React Native projects and ignoring cross-platform needs.
The author admits the built-in React Native WebView now has more features, making this component largely obsolete for modern development.
Requires dragging Objective-C files into XCode and linking libraries, adding unnecessary setup complexity compared to JavaScript-only solutions.