ddd6efd77b
## [5.0.7](https://github.com/react-native-community/react-native-webview/compare/v5.0.6...v5.0.7) (2019-02-08)
### Bug Fixes
* **package.json:** Warning because peerDependencies >=0.57 <0.59 ([#279](https://github.com/react-native-community/react-native-webview/issues/279)) ([#327](https://github.com/react-native-community/react-native-webview/issues/327)) ([
|
||
---|---|---|
.circleci | ||
android | ||
bin | ||
docs | ||
ios | ||
js | ||
typings | ||
.all-contributorsrc | ||
.flowconfig | ||
.flowconfig.android | ||
.gitignore | ||
.releaserc | ||
LICENSE | ||
README.md | ||
babel.config.js | ||
index.js | ||
jest.config.js | ||
package.json | ||
react-native-webview.podspec | ||
yarn.lock |
README.md
React Native WebView - a Modern, Cross-Platform WebView for React Native
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).
We just swapped out the React Native WebView in our app with the version from React Native Community. The swap took less than a day, required almost no code modifications, and is faster and CSS works better. Props to everyone in the community (including those at Infinite Red) that helped get that component split out.
Garrett McCullough, mobile engineer at Virta Health
Platforms Supported
- iOS (both UIWebView and WKWebView)
- Android
Note: React Native WebView is not currently supported by Expo unless you "eject".
Versioning
If you need the exact same WebView as the one from react-native, please use version 2.0.0. Future versions will follow semantic versioning.
Getting Started
$ yarn add react-native-webview
$ react-native link react-native-webview
Read our Getting Started Guide for more.
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://infinite.red/react-native" }}
style={{ marginTop: 20 }}
/>
);
}
}
For more, read the API Reference and Guide. If you're interested in contributing, check out the Contributing Guide.
Migrate from React Native core WebView to React Native WebView
Simply install React Native WebView and then use it in place of the core WebView. Their APIs are currently identical, except that this package defaults useWebKit={true}
unlike the built-in WebView.
Troubleshooting
- If you're getting
Invariant Violation: Native component for "RNCWKWebView does not exist"
it likely means you forgot to runreact-native link
or there was some error with the linking process
Contributing
See Contributing.md
Maintainers
- Jamon Holmgren (Twitter @jamonholmgren) from Infinite Red
- Thibault Malbranche (Twitter @titozzz) from Brigad
- Empyrical (Twitter @empyrical)
Contributors
Thanks goes to these wonderful people (emoji key):
Thibault Malbranche 💻 🤔 👀 📖 🚧 ⚠️ 🚇 💬 |
Jamon Holmgren 💻 🤔 👀 📖 🚧 ⚠️ 💡 💬 |
Andrei Pfeiffer 💻 👀 🤔 |
Michael Diarmid 💻 👀 🤔 🔧 |
Scott Mathson 💻 📖 |
Margaret 💻 📖 |
Jordan Sexton 💻 📖 |
---|---|---|---|---|---|---|
Malcolm Scruggs 💻 🔧 ⚠️ |
This project follows the all-contributors specification. Contributions of any kind welcome!
License
MIT