Coder Social home page Coder Social logo

jackburns / react-native-webview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from react-native-webview/react-native-webview

0.0 1.0 0.0 993 KB

React Native Cross-Platform WebView

Home Page: https://github.com/react-native-community/discussions-and-proposals/pull/3

License: MIT License

Java 29.21% Kotlin 2.45% JavaScript 34.94% Shell 0.44% Objective-C 32.61% Ruby 0.34%

react-native-webview's Introduction

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

star this repo PRs Welcome All Contributors Known Vulnerabilities

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 run react-native link or there was some error with the linking process
  • There's a problem on some Android devices where the webview could overlap previous siblings from same parent. To fix this, wrap the WebView in a View with style overflow: hidden.

Contributing

See Contributing.md

Maintainers

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

๐Ÿ“–

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

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.