我目前正在开发一个刚刚开始开发的小应用程序,我一直收到这个错误:
Invariant Violation: requireNativeComponent: "RNCViewPager" was not found in the UIManager.
This error is located at:
in RNCViewPager (at ViewPager.js:150)
in ViewPager (at createAnimatedComponent.js:151)
in AnimatedComponent (at react-native-scrollable-tab-view/index.js:253)
in RCTView (at View.js:45)
我正在使用从‘react-native-scrollable- ScrollableTabView -view’导入标签页,{ DefaultTabBar };我猜这就是错误所在,我搜索了stackoverflow,发现我必须安装@react-native-community/viewpager,但在安卓仿真器中仍然得到相同的错误( Ios仿真器可以工作)
下面是我的代码:
import React from 'react';
import {
Text
} from 'react-native';
import ScrollableTabView, { DefaultTabBar } from 'react-native-scrollable-tab-view';
//import ViewPager from '@react-native-community/viewpager'
export default () => {
return }
>
favorite
project
;
}
谢谢!
发布于 2021-03-01 16:53:23
请在您的终端上运行以下命令
=> npm i @react-native-community/viewpager
https://stackoverflow.com/questions/59953648
复制相似问题