React Native Wkwebview screenshot

React Native Wkwebview

Author Avatar Theme by Cralpha
Updated: 27 Jan 2022
639 Stars

WKWebview Component for React Native

Categories

Overview:

The React Native WKWebView provides a WKWebView component for React Native projects, offering improved performance over the UIWebView component on iOS. It requires a deployment target of iOS 8.0 or higher and can be easily integrated using npm and Xcode.

Features:

  • Performance Boost: Utilizes WKWebView introduced in iOS 8.
  • Compatibility: Aims to replace UIWebView with similar functionality.
  • Additional Props: Offers callbacks for loading progress, response headers, and more.

Installation:

To install the React Native WKWebView, follow these steps:

  1. Install the package from npm:

    npm install react-native-wkwebview-reborn
    
  2. Link the package in Xcode:

    • Right-click on your project’s Libraries folder in Xcode.
    • Select “Add Files to <…>” and choose RCTWKWebView.xcodeproj from node_modules/react-native-wkwebview-reborn/ios/.
    • In Xcode, go to your build target ➜ Build Phases ➜ Link Binary With Libraries, click “+” and select libRCTWkWebView.a.
    • Ensure Minimum Deployment Target is set to 8.0.
  3. Usage: Try replacing your existing WebView with WKWebView for improved performance. Use version 2.x for React Native >= 0.57 and version 0.x for React Native < 0.40.

Summary:

The React Native WKWebView offers a performance boost by utilizing WKWebView in iOS 8. It provides easy integration with npm installation and Xcode linking. Compatibility with UIWebView and additional props for customization make it a suitable choice for React Native projects requiring web view functionality.