本文介绍了不变违规:requireNativeComponent:“RNCWebView";在 UIManager 中找不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友,我在将 react-native-webview 链接到我的项目后遇到这个错误
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)
还有我的代码
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>' }}
/>
);
}
}
推荐答案
run react-native link react-native-webview
检查:https://github.com/react-native-community/react-native-webview/issues/140
这篇关于不变违规:requireNativeComponent:“RNCWebView";在 UIManager 中找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!