@builder.io/react-native-render-html

中文文档
6.3.4发布于 2024/06/27BSD-2-ClauseTypeScriptCommonJS近 30 天下载 2.9万

The hackable, full-featured Open Source HTML rendering solution for React Native.

原始使用文档
文档目录11 节
  1. 🗃️ Releases
  2. :computer: Install
  3. :speedboat: Basic Usage
  4. :blue_book: Documentation
  5. :iphone: Example
  6. :notebook: Changelog
  7. :bulb: Help
  8. 👥 Community
  9. :pencil: Contributing
  10. :blue_heart: Sponsorship
  11. :balance_scale: License

platforms runs with expo
npm npm npm
github issues
Rate on Openbase


react-native-render-html

Based on the original work of Thomas Beverley, props to him.

An iOS/Android pure javascript react-native component that renders your HTML into 100% native views.

🗃️ Releases

The Foundry (v6) release is finally stable, and is now-on the recommended version. Check out the announcement blog post in our brand new website. We also have a migration guide for those who are coming from v5 and below.

:warning: You are on the master branch which is home for the latest development. Check the table bellow to get documentation for your exact version.

MinorBranchDocumentationLatest
nextmaster-npm
6.3release/6.3Official Websitenpm
5.1  release/5.1  release/5.1/README.mdnpm
4.2  release/4.2  release/4.2/README.mdnpm

:computer: Install

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

:speedboat: Basic Usage

import React from 'react';
import { useWindowDimensions } from 'react-native';
import RenderHtml from 'react-native-render-html';

const source = {
  html: `
<p style='text-align:center;'>
  Hello World!
</p>`
};

export default function App() {
  const { width } = useWindowDimensions();
  return (
    <RenderHtml
      contentWidth={width}
      source={source}
    />
  );
}

:blue_book: Documentation

See our official website and the official Discovery App.

:iphone: Example

You like to learn by example? We have a tutorial from which the demo GIF has been extracted: A WebView-free Blog App with React Native Render HTML.

:notebook: Changelog

The changelog is available here: packages/render-html/CHANGELOG.md.

:bulb: Help

Please refer to our dedicated document.

👥 Community

You're always welcome to join our discord channel :-).

:pencil: Contributing

Check-out our contributing guide.

:blue_heart: Sponsorship

Want to support this project or hire us to implement a feature? Check out this page.

:balance_scale: License

The source code is licensed under BSD 2-Clause "Simplified" License.

版本与发布记录

@builder.io/react-native-render-html 共发布 1 个版本,首次发布于 2024/06/27;过去 12 个月发布了 0 个版本。

版本发布日期距今
6.3.4latest2024/06/272 年前

关于 @builder.io/react-native-render-html 的常见问题

@builder.io/react-native-render-html 是什么?

The hackable, full-featured Open Source HTML rendering solution for React Native.

如何安装 @builder.io/react-native-render-html?

在项目目录运行 npm install @builder.io/react-native-render-html,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(*)、react-native(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@builder.io/react-native-render-html 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@builder.io/react-native-render-html 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@builder.io/react-native-render-html 可以商用吗?

@builder.io/react-native-render-html 使用 BSD-2-Clause 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@builder.io/react-native-render-html 的下载量有多少?

根据 npm 官方下载统计,@builder.io/react-native-render-html 在 2026/10/09 – 2026/11/07 这 30 天内被下载 29,473 次,日均约 982 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@builder.io/react-native-render-html 还在维护吗?

最新版本 6.3.4 发布于 2024/06/27(2 年前);至今共发布 1 个版本,其中过去 12 个月发布了 0 个;首次发布于 2024/06/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。