朋友们好,我在将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>' }}
      />
    );
  }
}

Error Image in my android

推荐答案

react-native link react-native-webview

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

React-native相关问答推荐

AWS Amplify处理后端错误

NativeWind边框 colored颜色 在Reaction Native应用程序中未按预期工作

文本输入提示

使用 Auth Token 标头react 本机图像,如何处理 401?

任务:react-native-async-storage_async-storage:generateDebugRFile FAILED

react native 如何更新倒置平面列表的数组中的项目

用图像 react native 动画进度条

在 ReactNative 中调用 RCTDeviceEventEmitter.emit 时出错

从 React 原生 Js 代码调用 Android Native UI 组件方法

如何将谷歌反向地理编码与 React Native Expo 结合使用?

如何从 Firebase 获取所有设备令牌?

React Native - ScrollView 中的 ListView 分页?

React-Native Packager 失败:重复的模块名称

从组件的 style属性中获取 CSS 属性值

React Native 中使用了哪些维度单位?

React Native 得到这个错误'Unrecognized operator abs'

更改导航标题背景 colored颜色

React 在任何根目录中都找不到入口文件

React Native:无法解析模块 fs

如何在 React-Native 中停止touch 事件传播