MCPcopy
hub / github.com/react-native-webview/react-native-webview

github.com/react-native-webview/react-native-webview @v14.0.1 sqlite

repository ↗ · DeepWiki ↗ · release v14.0.1 ↗
435 symbols 767 edges 60 files 7 documented · 2%
README

React Native WebView

star this repo PRs Welcome NPM Version Npm Downloads

React Native WebView is a community-maintained WebView component for React Native. It is intended to be a replacement for the built-in WebView (which was removed from core).

Maintainers

Many thanks to these companies for providing us with time to work on open source.
Please note that maintainers spend a lot of free time working on this too so feel free to sponsor them, it really makes a difference.

Windows and macOS are managed by Microsoft, notably:

Shout-out to Jamon Holmgren from Infinite Red for helping a lot with the repo when he had more available time.

Disclaimer

Maintaining WebView is very complex because it is often used for many different use cases (rendering SVGs, PDFs, login flows, and much more). We also support many platforms and both architectures of react-native.

Since WebView was extracted from the React Native core, nearly 500 pull requests have been merged.
Considering that we have limited time, issues will mostly serve as a discussion place for the community, while we will prioritize reviewing and merging pull requests.

Platform compatibility

This project is compatible with iOS, Android, Windows and macOS.
This project supports both the old (paper) and the new architecture (fabric).
This project is compatible with expo.

Getting Started

Read our Getting Started Guide. If any step seems unclear, please create a pull request.

Versioning

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

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

// ...
const MyWebComponent = () => {
  return (
    <WebView
      source={{ uri: 'https://reactnative.dev/' }}
      style={{ flex: 1 }}
    />
  );
};

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
  • If you encounter a build error during the task :app:mergeDexRelease, you need to enable multidex support in android/app/build.gradle as discussed in this issue

Contributing

Contributions are welcome, see Contributing.md

License

MIT

Translations

This readme is available in:

Extension points exported contracts — how you extend this code

Spec (Interface)
(no doc) [3 implementers]
src/NativeRNCWebViewModule.ts
RNCWebViewConfig (Interface)
Implement this interface in order to config your WebView. An instance of that implementation will have to be giv
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewConfig.java
State (Interface)
(no doc)
example/App.tsx
Props (Interface)
(no doc)
example/examples/Suppress.tsx
NativeProps (Interface)
(no doc)
src/RNCWebViewNativeComponent.ts
RNCWebViewUIManager (Interface)
(no doc)
src/WebViewTypes.ts
State (Interface)
(no doc)
example/examples/Suppress.tsx
NativeCommands (Interface)
(no doc)
src/RNCWebViewNativeComponent.ts

Core symbols most depended-on inside this repo

postMessage
called by 17
android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java
dispatchEvent
called by 14
android/src/main/java/com/reactnativecommunity/webview/RNCWebView.java
getThemedReactContext
called by 9
android/src/main/java/com/reactnativecommunity/webview/RNCWebView.java
createWebViewEvent
called by 9
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewClient.java
createOnShouldStartLoadWithRequest
called by 8
src/WebViewShared.tsx
useWarnIfChanges
called by 7
src/WebView.ios.tsx
reload
called by 6
android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java
evaluateJavascriptWithFallback
called by 5
android/src/main/java/com/reactnativecommunity/webview/RNCWebView.java

Shape

Method 302
Class 63
Interface 42
Function 26
Enum 2

Languages

Java68%
TypeScript32%

Modules by API surface

android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java100 symbols
android/src/oldarch/com/reactnativecommunity/webview/RNCWebViewManager.java56 symbols
android/src/main/java/com/reactnativecommunity/webview/RNCWebView.java48 symbols
src/WebViewTypes.ts37 symbols
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewModuleImpl.java32 symbols
android/src/main/java/com/reactnativecommunity/webview/RNCWebChromeClient.java18 symbols
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewClient.java15 symbols
src/WebViewShared.tsx8 symbols
android/src/oldarch/com/reactnativecommunity/webview/RNCWebViewModule.java8 symbols
android/src/newarch/com/reactnativecommunity/webview/RNCWebViewModule.java8 symbols
example/examples/Suppress.tsx5 symbols
example/examples/NativeWebpage.tsx5 symbols

Dependencies from manifests, versioned

@babel/cli7.29.7 · 1×
@babel/core7.29.7 · 1×
@babel/runtime7.29.7 · 1×
@callstack/react-native-visionos0.73.8 · 1×
@react-native/babel-preset0.73.21 · 1×
@react-native/eslint-config0.73.2 · 1×
@react-native/metro-config0.73.5 · 1×
@react-native/typescript-config0.73.1 · 1×
@rnx-kit/metro-config1.3.15 · 1×
@semantic-release/commit-analyzer13.0.1 · 1×
@semantic-release/git10.0.1 · 1×

For agents

$ claude mcp add react-native-webview \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact