react-native-webview

A community-maintained, cross-platform WebView component for React Native, replacing the deprecated built-in WebView with deep native web-rendering control.

Library
npm
v14.0.1
7,191stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
78/100Good
Development Activity52
Maintenance84
Community76
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
74/100Good
Architecture82
Code Quality68
Innovation55
Learning Curve90

react-native-webview is the de facto standard for embedding web content inside a React Native app. It was extracted from React Native core once the built-in WebView was deprecated, and has since grown into a far more capable component: it exposes fine-grained control over navigation interception, JavaScript injection (both before and after page load), bidirectional messaging between native and web contexts, file downloads, HTTP error handling, and dozens of platform-specific behaviors like pull-to-refresh, incognito mode, and Apple Pay support on iOS.

The library targets iOS, Android, Windows, and macOS from a single component API, with each platform backed by its own native implementation (WKWebView on Apple platforms, Android’s WebView, and WebView2 on Windows). As of the current major version it only supports React Native’s new architecture (Fabric) and requires React Native 0.76+, reflecting the project’s decision to shed legacy-architecture maintenance burden in favor of the codegen-based native module system. It is also Expo-compatible, making it usable in both bare and managed React Native workflows.

What You Get

  • A drop-in <WebView> component with a unified prop API across iOS, Android, macOS, and Windows
  • Fine-grained navigation control via onShouldStartLoadWithRequest and an origin whitelist to block unwanted URL loads
  • Two-way communication between native and web content through injectedJavaScript, injectedJavaScriptBeforeContentLoaded, and postMessage/onMessage
  • Lifecycle and error event hooks (onLoadStart, onLoadProgress, onError, onHttpError, onContentProcessDidTerminate, onFileDownload)
  • Imperative methods for programmatic control: goBack, goForward, reload, stopLoading, injectJavaScript, clearCache
  • Platform-specific fine-tuning props (e.g. allowsBackForwardNavigationGestures and enableApplePay on iOS, mixedContentMode and thirdPartyCookiesEnabled on Android, useWebView2 on Windows)

Common Use Cases

  • Rendering hosted web pages, documentation, or marketing content inside a native app shell
  • Embedding third-party checkout, OAuth, or SSO login flows that must run in a real browser context
  • Rendering PDFs, SVGs, or other web-native content formats that have no native RN renderer
  • Building a hybrid app that shares a web codebase for parts of the UI while the surrounding app stays native
  • Bridging native app state and a web page via injected JavaScript and postMessage-based messaging

Under The Hood

Architecture The library ships one shared logic module (WebViewShared.tsx) that implements origin-whitelist matching, the onShouldStartLoadWithRequest interception pipeline, and default loading/error renderers, while each platform gets its own top-level component (WebView.ios.tsx, WebView.android.tsx, WebView.macos.tsx, WebView.windows.tsx) that wires that shared logic into a platform-specific native host component generated via React Native’s Fabric codegen (RNCWebViewNativeComponent, RNCWebViewSpec). Native behavior lives in per-platform source trees (Kotlin/Java under android/src, Objective-C/Swift under apple/ios, C++/C# under windows), each implementing its own WebViewClient/WKWebView/WebView2 wrapper, event emitters (TopLoadingStartEvent, TopMessageEvent, etc.), and a native module (RNCWebViewModule) that resolves the async shouldStartLoadWithRequest decision back into the underlying platform WebView. Changing the shared JS layer risks behavior drift across four independently-maintained native backends, so the project leans heavily on its per-platform CI matrix to catch regressions.

Tech Stack The package is TypeScript-first (typed via WebViewTypes.ts and platform-specific prop interfaces), built with Babel for JS output and a separate TypeScript declaration-emit step, and linted/formatted with oxlint and oxfmt rather than ESLint/Prettier. It only declares escape-string-regexp and invariant as runtime dependencies, keeping the JS footprint minimal, while react and react-native are peer dependencies. The native side depends on each platform’s own toolchain (Gradle/Kotlin for Android, CocoaPods/Xcode for iOS/macOS, MSBuild/NuGet for Windows), and the project is released via semantic-release with automated changelog generation and per-platform GitHub Actions CI (android-ci.yml, ios-ci.yml, macos-ci.yml, windows-ci.yml, lint.yml).

Code Quality JS-side testing is limited: only two test files exist (WebViewShared-test.js, RCTWebView2NativeComponent-test.js, ~400 lines combined) covering the whitelist/URL-interception logic and Windows native component config, with no test coverage of the iOS/Android/macOS component wrappers themselves — native-side correctness instead relies on manual QA and the example app across each per-platform CI workflow. Type safety is strong throughout the shared and platform-specific TypeScript files, using discriminated unions for view state and detailed prop/event interfaces. Naming is consistent and descriptive, and the codebase enforces strict linting via oxlint with react/rules-of-hooks and react/exhaustive-deps set to error.

What Makes It Unique Its distinguishing engineering choice is comprehensiveness rather than novelty: the component exposes an unusually large, deeply platform-aware prop surface (nearly 100 documented props) that lets host apps tune navigation, caching, cookies, media playback, and security behavior per platform rather than offering a lowest-common-denominator API. The project also made a deliberate, disruptive architectural bet by dropping legacy-architecture (Paper) support entirely in favor of the new Fabric architecture, trading short-term compatibility for a codegen-based native module system that keeps the JS and native layers in sync via a single spec file.

Used by 14 apps in this directory

TypeScript
99%
Apache 2.0

Colanode

Knowledge Management · Team Chat · Collaboration

5,097

Local-first, self-hosted workspace that combines real-time chat, Notion-style pages, and structured databases — all synced via CRDTs so you work offline without losing a keystroke.

View details
47
Repo Health
73
Technical
70
Dependency
Built with
TypeScript99%
Updated 5 months ago
TypeScript
71%
Other

highlight.io

Developer Tools · Analytics · Monitoring

9,372

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
69
Repo Health
78
Technical
65
Dependency
Built with
TypeScript71%
Go16%
Updated 2 weeks ago
TypeScript
74%
Apache 2.0

Jitsi Meet

Team Chat · Collaboration · Video Conferencing

29,879

Open-source, end-to-end encrypted video conferencing you can self-host or embed into any web or mobile app.

View details
96
Repo Health
85
Technical
69
Dependency
Built with
TypeScript74%
JavaScript10%
Updated yesterday
TypeScript
76%
Other

Joplin

Note Taking

56,257

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
61
Dependency
Built with
TypeScript76%
JavaScript14%
Updated yesterday
TypeScript
99%
AGPL 3.0

Karakeep

Bookmarks Archiving

28,871

Self-hosted bookmark manager that captures links, notes, images, and PDFs with AI tagging, full-text search, and automatic archiving.

View details
88
Repo Health
76
Technical
66
Dependency
Built with
TypeScript99%
Updated 1 weeks ago
TypeScript
93%
AGPL 3.0

Linkwarden

Bookmarks Archiving · Knowledge Management

19,702

Self-hosted collaborative bookmark manager that captures full-page archives, enables annotation, and keeps your knowledge accessible forever.

View details
89
Repo Health
72
Technical
66
Dependency
Built with
TypeScript93%
Updated 2 days ago
TypeScript
41%
MIT

MentraOS

Developer Tools · AI Development

2,336

The open source operating system and SDK that lets developers build one app and run it across smart glasses from Even Realities, Vuzix, Mentra Live, and more.

View details
92
Repo Health
77
Technical
66
Dependency
Built with
TypeScript41%
Java24%
Kotlin10%
Updated yesterday
TypeScript
85%
GPL 3.0

Notesnook

Note Taking · File Storage · Security

14,533

End-to-end encrypted, open-source note-taking where your data stays yours — even from the server.

View details
90
Repo Health
84
Technical
60
Dependency
Built with
TypeScript85%
JavaScript12%
Updated 2 days ago
TypeScript
96%
MIT

Orca

AI Agents · AI Code Assistants

62,825

An open-source Agent Development Environment that orchestrates fleets of parallel AI coding agents — Claude Code, Codex, Gemini and more — each running in its own isolated git worktree.

View details
83
Repo Health
85
Technical
80
Dependency
Built with
TypeScript96%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search