Registry / devops / react-native-offline-cache-webview

react-native-offline-cache-webview

JSON →
library0.1.2jsnpmunverified

A React Native WebView component with offline caching support for both iOS and Android. Version 0.1.2 is the latest stable release. It uses iOS's RNCachingURLProtocol and Android's CacheWebView to enable offline browsing by caching HTTP responses to disk. Differentiates from basic WebView by adding built-in offline cache, cookie management, and JS bridge. The library depends on react-native-advanced-webview and requires manual linking. Note: this project appears unmaintained (last commit in 2018) and relies on outdated dependencies.

npm install react-native-offline-cache-webview
INSTALL
IMPORT
SIG · REACT-NATIVE-OFFLI
R
react-native-offline-cache-webview
devopsjavascriptv0.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OfflineCacheWebView
import OfflineCacheWebView from 'react-native-offline-cache-webview';
const OfflineCacheWebView = require('react-native-offline-cache-webview');
This library only provides a default export. CommonJS require works but is not typical for React Native projects.
OfflineCacheWebView
const OfflineCacheWebView = require('react-native-offline-cache-webview').default;
const { OfflineCacheWebView } = require('react-native-offline-cache-webview');
Destructured import fails because there is no named export. Must use .default with require.
types
// No TypeScript types provided; use @types/react-native or custom typings
import { OfflineCacheWebViewProps } from 'react-native-offline-cache-webview';
No TypeScript declarations exist. Trying to import types will cause errors.

Shows basic usage: import the default component and render it with a source URI. Requires manual linking after install.

import React, { Component } from 'react'; import { View, StyleSheet } from 'react-native'; import OfflineCacheWebView from 'react-native-offline-cache-webview'; export default class App extends Component { render() { return ( <View style={styles.container}> <OfflineCacheWebView style={styles.webview} source={{ uri: 'https://www.example.com' }} /> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1 }, webview: { flex: 1 }, });
Debug
Known issues
deprecatedLibrary is no longer maintained; last updated in 2018. Use at your own risk.
fix
Consider alternative like react-native-webview with custom cache handling or react-native-offline.
affects: >=0.0.0
breakingRequires manual linking with react-native link; autolinking may not work in newer React Native versions.
fix
For RN >=0.60, use npx react-native link react-native-offline-cache-webview or CocoaPods for iOS.
affects: >=0.60.0
gotchaiOS uses RNCachingURLProtocol which may conflict with other URL protocol handlers.
fix
Ensure no duplicate registration of NSURLProtocol handlers.
affects: >=0.0.0
gotchaAndroid CacheWebView may not work with HTTPS URLs that have certificate issues.
fix
Use proper SSL certificates or configure WebView to accept them.
affects: >=0.0.0
deprecatedUses prop-types; consider migrating to React Native's own type checking or TypeScript.
fix
No fix required; functional but not modern.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'react-native-offline-cache-webview'
Module not linked or installed properly.
fix
Run npm install react-native-offline-cache-webview --save and then react-native link react-native-offline-cache-webview
TypeError: undefined is not an object (evaluating 'OfflineCacheWebView.propTypes')
Importing incorrectly (destructuring named export).
fix
Use default import: import OfflineCacheWebView from 'react-native-offline-cache-webview';
Module 'react-native-offline-cache-webview' does not exist in the Haste module map
Metro bundler cannot resolve the module; likely not linked.
fix
Ensure library is linked: react-native link react-native-offline-cache-webview and clear Metro cache.
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
react-nativerequiredPeer dependency required for native modules.
reactrequiredPeer dependency required for component lifecycle.
prop-typesrequiredPeer dependency for type checking.
Agent activity
4 hits · last 30 days
node
4
Resources
react-native-offline-cache-webview — npm install react-native-offline-cache-webview · libregistry