不変違反: requireNativeComponent: 「RNCWebView」が UIManager に見つかりませんでした 質問する

不変違反: requireNativeComponent: 「RNCWebView」が UIManager に見つかりませんでした 質問する

こんにちは、react-native-webviewをプロジェクトにリンクした後にこのエラーが発生しました

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)

そしてこれが私のコードです

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>' }}
      />
    );
  }
}

Androidのエラー画像

ベストアンサー1

走るreact-native link react-native-webview

チェック:https://github.com/react-native-community/react-native-webview/issues/140

おすすめ記事