1 Star 0 Fork 0

damon.lin / react-native-webview

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

React Native WebView - a Modern, Cross-Platform WebView for React Native

star this repo PRs Welcome All Contributors Known Vulnerabilities NPM Version Lean Core Extracted

React Native WebView is a modern, well-supported, and cross-platform WebView for React Native. It is intended to be a replacement for the built-in WebView (which will be removed from core).

Core Maintainers - Sponsoring companies

This project is maintained for free by these people using both their free time and their company work time.

Platforms Supported

  • iOS
  • Android
  • macOS
  • Windows

Note: Expo support for React Native WebView started with Expo SDK v33.0.0.

Getting Started

Read our Getting Started Guide. If any step seems unclear, please create a detailed issue.

Versioning

This project follows semantic versioning. We do not hesitate to release breaking changes but they will be in a major version.

Breaking History:

Current Version: version

  • 10.0.0 - Android Gradle plugin is only required when opening the project stand-alone
  • 9.0.0 - props updates to injectedJavaScript are no longer immutable.
  • 8.0.0 - onNavigationStateChange now triggers with hash url changes
  • 7.0.1 - Removed UIWebView
  • 6.0.2 - Update to AndroidX. Make sure to enable it in your project's android/gradle.properties. See Getting Started Guide.
  • 5.0.1 - Refactored the old postMessage implementation for communication from webview to native.
  • 4.0.0 - Added cache (enabled by default).
  • 3.0.0 - WKWebview: Add shared process pool so cookies and localStorage are shared across webviews in iOS (enabled by default).
  • 2.0.0 - First release this is a replica of the core webview component

Upcoming:

  • this.webView.postMessage() removal (never documented and less flexible than injectJavascript) -> how to migrate
  • Kotlin rewrite
  • Maybe Swift rewrite

Usage

Import the WebView component from react-native-webview and use it like so:

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/' }} />;
  }
}

For more, read the API Reference and Guide. If you're interested in contributing, check out the Contributing Guide.

Common issues

  • If you're getting Invariant Violation: Native component for "RNCWebView does not exist" it likely means you forgot to run react-native link or there was some error with the linking process

Contributing

See Contributing.md

Contributors

Thanks goes to these wonderful people (emoji key):

Thibault Malbranche
Thibault Malbranche

💻 🤔 👀 📖 🚧 ⚠️ 🚇 💬
Jamon Holmgren
Jamon Holmgren

💻 🤔 👀 📖 🚧 ⚠️ 💡 💬
Andrei Pfeiffer
Andrei Pfeiffer

💻 👀 🤔
Michael Diarmid
Michael Diarmid

💻 👀 🤔 🔧
Scott Mathson
Scott Mathson

💻 📖
Margaret
Margaret

💻 📖
Jordan Sexton
Jordan Sexton

💻 📖
Malcolm Scruggs
Malcolm Scruggs

💻 🔧 ⚠️
Momazo7u7
Momazo7u7

📖
Marco
Marco

📖
Julien Eluard
Julien Eluard

📖
Jian Wei
Jian Wei

💻 📖
Sergei Butko
Sergei Butko

📖
TMomemt
TMomemt

💻
Eric Lewis
Eric Lewis

💻 📖
Daniel Vicory
Daniel Vicory

💻 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT

Translations

This readme is available in:

MIT License Copyright (c) 2015-present, Facebook, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/daimons/react-native-webview.git
git@gitee.com:daimons/react-native-webview.git
daimons
react-native-webview
react-native-webview
master

搜索帮助