How to use the react-native-webview.WebView.propTypes function in react-native-webview

To help you get started, we’ve selected a few react-native-webview examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RangerMauve / datmobile / react-native-protocol-webview / index.js View on Github external
import React, { Component } from 'react'
import ReactNative, { UIManager, requireNativeComponent } from 'react-native'

import { WebView } from 'react-native-webview'

export class ProtocolWebView extends Component {
	static propTypes = WebView.propTypes;

	static protocolHandlers = {};

	static registerStreamProtocol = (scheme, handler, completion) => {
		ProtocolWebView.protocolHandlers[scheme] = (url, method, id, webview) => {
			handler({url, method}, (response) => {
				let stream = response;
				let mimeType = response.mimeType;
				if(response.data) {
					stream = response.data
				}

				if(!mimeType) {
					mimeType = stream.mimeType
				}

react-native-webview

React Native WebView component for iOS, Android, macOS, and Windows

MIT
Latest version published 3 days ago

Package Health Score

95 / 100
Full package analysis