react-native-webview/react-native-webview
GitHub: react-native-webview/react-native-webview
React Native 社区维护的跨平台 WebView 组件,替代已从核心库移除的内置 WebView,支持 iOS、Android、Windows 和 macOS。
Stars: 7181 | Forks: 3174
# React Native WebView
**React Native WebView** 是一个由社区维护的 React Native WebView 组件。它旨在替代内置的 WebView(该组件已[从核心库中移除](https://github.com/react-native-community/discussions-and-proposals/pull/3))。
### 维护者
**非常感谢这些公司**为我们提供工作时间来参与开源项目。
请注意,维护者们也投入了大量的业余时间来进行开发,因此欢迎赞助他们,**这真的意义重大。**
- 来自 [Brigad](https://www.brigad.co/en-gb/about-us) 的 [Thibault Malbranche](https://github.com/Titozzz)([Twitter @titozzz](https://twitter.com/titozzz))
[_赞助我_ ❤️ !](https://github.com/sponsors/Titozzz)
Windows 和 macOS 版本由 Microsoft 维护,特别是:
- 来自 [React Native for Windows](https://microsoft.github.io/react-native-windows/) 的 [Alexander Sklar](https://github.com/asklar)([Twitter @alexsklar](https://twitter.com/alexsklar))
- 来自 [React Native for Windows @ Microsoft](https://microsoft.github.io/react-native-windows/) 的 [Chiara Mooney](https://github.com/chiaramooney)
特别感谢来自 [Infinite Red](https://infinite.red) 的 [Jamon Holmgren](https://github.com/jamonholmgren),在他有更多空闲时间时为本仓库提供了大量帮助。
### 免责声明
维护 WebView 非常复杂,因为它常被用于许多不同的场景(渲染 SVG、PDF、登录流程等)。我们还需要支持多个平台以及 react-native 的两种架构。
自从 WebView 从 React Native 核心库中分离出来后,我们已经合并了近 500 个 pull request。
考虑到我们的时间有限,issues 主要作为社区交流的场所,同时**我们将优先审查和合并 pull request。**
### 平台兼容性
本项目兼容 **iOS**、**Android**、**Windows** 和 **macOS**。
本项目支持**旧架构**(paper)**和新架构**(fabric)。
本项目兼容 [expo](https://docs.expo.dev/versions/latest/sdk/webview/)。
### 快速开始
阅读我们的[快速开始指南](docs/Getting-Started.md)。如果其中有任何步骤看起来不清楚,欢迎提交 pull request。
### 版本控制
本项目遵循[语义化版本控制](https://semver.org/)。我们会毫不犹豫地发布破坏性更新,但它们将包含在大版本中。
### 用法
从 `react-native-webview` 导入 `WebView` 组件,并按如下方式使用:
```
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { WebView } from 'react-native-webview';
// ...
const MyWebComponent = () => {
return (
);
};
```
了解更多信息,请阅读 [API 参考](./docs/Reference.md)和[指南](./docs/Guide.md)。如果你有意做出贡献,请查看[贡献指南](./docs/Contributing.md)。
### 常见问题
- 如果你遇到 `Invariant Violation: Native component for "RNCWebView does not exist"` 错误,这通常意味着你忘记运行 `react-native link`,或者在链接过程中出现了一些错误
- 如果你在执行 `:app:mergeDexRelease` 任务时遇到构建错误,你需要在 `android/app/build.gradle` 中启用 multidex 支持,正如[此 issue](https://github.com/react-native-webview/react-native-webview/issues/1344#issuecomment-650544648) 中所讨论的
### 许可证
MIT
### 翻译
本自述文件提供以下语言版本:
- [巴西葡萄牙语](docs/README.portuguese.md)
- [法语](docs/README.french.md)
- [意大利语](docs/README.italian.md)
标签:React Native, UI组件, WebView, 数据可视化, 移动开发, 自动化攻击