# @exodus/react-native-webview 中文文档

规范地址：https://npmcn.com/package/%40exodus/react-native-webview/

版本：11\.26\.1-exodus\.42
npm 元数据更新时间：2026-11-02T11:08:20.502Z
中文译文更新时间：2026-11-14T04:06:43.666Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40exodus/react-native-webview
原文对照：https://npmcn.com/package/%40exodus/react-native-webview/?lang=original
项目主页：https://github.com/ExodusMovement/react-native-webview#readme
源码仓库：https://github.com/ExodusMovement/react-native-webview

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：243 kB，52 个文件
- 模块格式：CommonJS
- TypeScript 类型：包内自带
- 运行依赖：2 个
- peer 依赖：react \*，react-native \*
- 首次发布：2020-05-19T15:21:55.639Z
- 最新版本发布：2026-11-02T11:08:20.302Z
- 近 30 天下载量：11458（2026-10-14 至 2026-11-12，npm 官方下载统计）
- 已发布版本数：53（近 12 个月 13 个）

## 中文简介

反应 iOS、Android、macOS 和 Windows 的原始 Webview 组件

## 安装

```sh
npm install @exodus/react-native-webview
```

也可以使用：`pnpm add @exodus/react-native-webview`、`yarn add @exodus/react-native-webview`、`bun add @exodus/react-native-webview`

## README

# 反应原生Webiew - 一个现代,跨平面的Webview 反应原生

[![star this repo](http://githubbadges.com/star.svg?user=react-native-webview&repo=react-native-webview&style=flat)](https://github.com/react-native-webview/react-native-webview) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com/) [![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](https://npmcn.com/package/%40exodus/react-native-webview/#readme-contributors) [![Known Vulnerabilities](https://snyk.io/test/github/react-native-webview/react-native-webview/badge.svg?style=flat-square)](https://snyk.io/test/github/react-native-webview/react-native-webview) [![NPM Version](https://img.shields.io/npm/v/react-native-webview.svg?style=flat-square)](https://www.npmjs.com/package/react-native-webview) [![Lean Core Extracted](https://img.shields.io/badge/Lean%20Core-Extracted-brightgreen.svg?style=flat-square)](https://github.com/facebook/react-native/issues/23313)

**反应原生网络视频** 是一个现代的, 得到良好支持的, 和跨平台的 WebView for React Industrial. 它的用意是取代内置的WebView(即: [从核心删除](https://github.com/react-native-community/discussions-and-proposals/pull/3)) (中文(简体) ).

## 核心维护者-赞助公司

_这个项目是一个叉子 [https://github.com/resact-native-webview/resact-native-webview 页面存档备份,存于互联网档案馆](https://github.com/react-native-webview/react-native-webview)。 。 。 . 请参考该存储库获得全额信用._

## 支持的平台

-   [x] iOS系统
-   [x] 机器人
-   [x] 马科斯
-   [x] 窗口
-   [x] 博览会(Android, iOS)

## 开始

读我们 [获取启动指南](https://npmcn.com/package/%40exodus/react-native-webview/docs/Getting-Started.md)如果任何步骤似乎不明确,请提出一个详细问题.

## 版本

这个项目紧随其后 [语义版本](https://semver.org/)。我们毫不犹豫地发布断开的更改,但它们将是一个主要版本.

**打破历史 :**

当前版本 : ![version](https://img.shields.io/npm/v/react-native-webview.svg)

-   [11.0.0 国家](https://github.com/react-native-webview/react-native-webview/releases/tag/v11.0.0) -Androidset 支持多功能窗口.
-   [10.0.0 (中文(简体) )](https://github.com/react-native-webview/react-native-webview/releases/tag/v10.0.0) - Android Gradle插件仅在项目独立打开时才需要
-   [9.0.0 (单位:千美元)](https://github.com/react-native-webview/react-native-webview/releases/tag/v9.0.0) - 注入JavaScript的道具更新不再不可改变.
-   [8.0.0 (单位:千美元)](https://github.com/react-native-webview/react-native-webview/releases/tag/v8.0.0) - 在导航上 StateChange 现在随着散列url的更改触发
-   [7.0.1 (中文(简体) )](https://github.com/react-native-webview/react-native-webview/releases/tag/v7.0.1) - 已删除 UIWebView
-   [6.0 (英语).**2个**](https://github.com/react-native-webview/react-native-webview/releases/tag/v6.0.2) - 更新到AndroidX 一定要在你的项目里启用它 `android/gradle.properties`。见 [获取启动指南](https://npmcn.com/package/%40exodus/react-native-webview/docs/Getting-Started.md)。 。 。 .
-   [5.0 (中文(简体) ).**1个**](https://github.com/react-native-webview/react-native-webview/releases/tag/v5.0.0) - 重新制定旧的Message后执行办法,以便从网络视图到本地进行交流.
-   [4.0.0 (单位:千美元)](https://github.com/react-native-webview/react-native-webview/releases/tag/v4.0.0) - 添加缓存(默认启用).
-   [3.0.0 (单位:千美元)](https://github.com/react-native-webview/react-native-webview/releases/tag/v3.0.0) - WKWebview:添加共享进程池,因此cookie和localStorage在iOS的网页视图中共享(默认启用).
-   [2.0.0 (韩语)](https://github.com/react-native-webview/react-native-webview/releases/tag/v2.0.0) - 第一版 这是核心网页内容的复制品

**即将到来 :**

-   (从未有文件记载,而且灵活性低于注射Javascript) - > [如何移徙](https://github.com/react-native-webview/react-native-webview/issues/809)
-   Kotlin 重写
-   也许斯威夫特重写

## 使用量

导入 `WebView` 构成部分从 `react-native-webview` 像这样使用它:

```jsx
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { WebView } from 'react-native-webview';

// ...
class MyWebComponent extends Component {
  render() {
    return <WebView source={{ uri: 'https://reactnative.dev/' }} />;
  }
}
```

将更多改为 [API 参考](https://npmcn.com/package/%40exodus/react-native-webview/docs/Reference.md) 财务报告和审定财务报表 [指南](https://npmcn.com/package/%40exodus/react-native-webview/docs/Guide.md)如果您有兴趣捐款,请查看 [贡献指南](https://npmcn.com/package/%40exodus/react-native-webview/docs/Contributing.md)。 。 。 .

## 共同问题

-   如果你得到一个 `Invariant Violation: Native component for "RNCWebView does not exist"` 可能意味着你忘了跑 `react-native link` 或连接进程出错
-   如果任务期间遇到构建错误 `:app:mergeDexRelease`中,需要启用多德克斯支持 `android/app/build.gradle` 一、导 言 [这个问题](https://github.com/react-native-webview/react-native-webview/issues/1344#issuecomment-650544648)

## 捐款

见 [捐款](https://github.com/react-native-webview/react-native-webview/blob/master/docs/Contributing.md)

## 贡献者

_这个项目是一个叉子 [https://github.com/resact-native-webview/resact-native-webview 页面存档备份,存于互联网档案馆](https://github.com/react-native-webview/react-native-webview)。 。 。 . 请参考该存储库获得全额信用._

## 许可证

麻省理工学院

## 翻译

本读取自:

-   [巴西葡萄牙语](https://npmcn.com/package/%40exodus/react-native-webview/docs/README.portuguese.md)
-   [法语](https://npmcn.com/package/%40exodus/react-native-webview/docs/README.french.md)

## 常见问题

### @exodus/react-native-webview 是什么？

反应 iOS、Android、macOS 和 Windows 的原始 Webview 组件

### 如何安装 @exodus/react-native-webview？

在项目目录运行 npm install @exodus/react-native-webview，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：react（\*）、react-native（\*）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @exodus/react-native-webview 支持 TypeScript 吗？

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

### @exodus/react-native-webview 支持 ESM 还是 CommonJS？

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

### @exodus/react-native-webview 可以商用吗？

@exodus/react-native-webview 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @exodus/react-native-webview 的下载量有多少？

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

### @exodus/react-native-webview 还在维护吗？

最新版本 11\.26\.1-exodus\.42 发布于 2026/11/02（11 天前）；至今共发布 53 个版本，其中过去 12 个月发布了 13 个；首次发布于 2020/05/19。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

