Render HTML in React Native

前端 未结 6 1171
陌清茗
陌清茗 2020-11-29 04:03

In my React Native app, I am pulling in JSON data that has raw HTML elements like this:

This is some text. Let’s figure out...

6条回答
  •  抹茶落季
    2020-11-29 04:15

    An iOS/Android 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.

    react-native-render-html

    use above library to improve your app performance level and easy to use.

    Install

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

    Basic usage

    import React, { Component } from 'react';
    import { ScrollView, Dimensions } from 'react-native';
    import HTML from 'react-native-render-html';
    
    const htmlContent = `
        

    This HTML snippet is now rendered with native components !

    Enjoy a webview-free and blazing fast application

    Look at how happy this native cat is `; export default class Demo extends Component { render () { return ( ); } }

    PROPS

    you may user it's different different types of props (see above link) for the designing and customizable also using below link refer.

    Customizable render html

提交回复
热议问题