【发布时间】:2020-09-02 01:06:31
【问题描述】:
您好朋友,我在将 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>' }}
/>
);
}
}
【问题讨论】:
-
你能告诉我们更多关于你想使用它的项目和它的代码吗?您是否检查过错误中提到的文件(即 WebView.android.js 中)的行在说什么?你可以给我们这个代码,也许这是一个开始。谢谢。
标签: react-native react-native-webview