Coder Social home page Coder Social logo

msdgwzhy6 / react-native-webview-crossplatform Goto Github PK

View Code? Open in Web Editor NEW

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

1.0 1.0 0.0 113 KB

ReactNative的Webview,适配IOS和Android,支持Url拦截

License: MIT License

Java 30.54% Shell 0.60% JavaScript 32.71% Objective-C 35.68% Ruby 0.47%

react-native-webview-crossplatform's Introduction

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

now,we can use the https://github.com/react-native-community/react-native-webview ,it support the method onShouldStartLoadWithRequest for Ios and Android

Platforms Supported

  • iOS (both UIWebView and WKWebView)
  • Android

Getting Started

$ yarn add react-native-webview-crossplatform
$ react-native link react-native-webview-crossplatform

Usage

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

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

// ...
class MyWebComponent extends Component {
  render() {
    return (
      <WebView
        source={{ uri: 'https://infinite.red/react-native' }}
        style={{ marginTop: 20 }}
        onLoadProgress={e=>console.log(e.nativeEvent.progress)}
        onShouldStartLoadWithRequest={e=>{
        console.log(e.nativeEvent.progress)
        return true
        }}
      />
    );
  }
}

For more, read the API Reference and Guide.

License

MIT

react-native-webview-crossplatform's People

Contributors

wayne214 avatar

Stargazers

 avatar

Watchers

 avatar

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.