Invariant Violation: requireNativeComponent: "RNCWebView" was not found in the UIManager

Sky Sakthi picture Sky Sakthi · May 16, 2020 · Viewed 15.6k times · Source

Hello friends i got this error after linking react-native-webview to my project

Invariant Violation: requireNativeComponent: "RNCWebView" was not found in the UIManager.

    This error is located at:
        in RNCWebView (at WebView.android.js:250)
        in RCTView (at WebView.android.js:253)
        in WebView (at App.js:7)
        in App (at renderApplication.js:45)
        in RCTView (at AppContainer.js:109)
        in RCTView (at AppContainer.js:135)
        in AppContainer (at renderApplication.js:39)

And there is my code

import React, { Component } from 'react';
import { WebView } from 'react-native-webview';

export default class App extends Component {
  render() {
    return (
      <WebView
        originWhitelist={['*']}
        source={{ html: '<h1>Hello world</h1>' }}
      />
    );
  }
}

Error Image in my android

Answer

user13142973 picture user13142973 · May 16, 2020

run react-native link react-native-webview

check: https://github.com/react-native-community/react-native-webview/issues/140