A pure JavaScript react-native component that renders your HTML into 100% native views. It's made to be extremely customizable and easy to use and aims at being able to render anything you throw at it.

Using this component will improve your application memory footprint and performance when compared with embedded WebViews.

Install

npm install react-native-render-html --save or yarn add react-native-render-html

Basic usage

import React, { Component } from "react";

import { ScrollView } from "react-native";

import RenderHtml from "react-native-render-html";

const html = `

This HTML snippet is now rendered with native components !

Enjoy a webview-free and blazing fast application

6225c62ef7661bdd07c46d1aca074df3.png

Look at how happy this native cat is

`;

export default class Demo extends Component {

render() {

return (

);

}

}

You may customize the style of elements via class names, tags, and you can even register custom renders for tags.

Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐