'React native Invariant Violation: requireNativeComponent: "RNCViewPager" was not found in the UIManager
i am currently working a small app i have just started working on and i keep getting this error:
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)
I am using import ScrollableTabView, { DefaultTabBar } from 'react-native-scrollable-tab-view'; and i guess this is where the error is getting from, i have searched on stackoverflow and found that i have to install @react-native-community/viewpager which i did, but still getting the same error in the Android emulator (the Ios emulator works)
here is my code:
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 <ScrollableTabView
style={{ marginTop: 20 }}
initialPage={1}
renderTabBar={() => <DefaultTabBar />}
>
<Text tabLabel='Tab #1'>
</Text>
<Text tabLabel='Tab #2'>favorite</Text>
<Text tabLabel='Tab #3'>project</Text>
</ScrollableTabView>;
}
Thank you !
Solution 1:[1]
Please run the following command in your terminal
=> npm i @react-native-community/viewpager
Solution 2:[2]
Install the below NPM library
npm i react-native-pager-view
Because, "@react-native-community/viewpager" is Deprecated.
Solution 3:[3]
Install the following package
npm i react-native-pager-view
After that open the ios folder in the terminal and run pod install. After the installation restart your project with npx react-native start.
Solution 4:[4]
if you use yarn
yarn add react-native-pager-view
if not, then
npm i react-native-pager-view
then you have to do
pod install
yarn ios or npx react-native run-ios
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | developer 004 |
| Solution 2 | Sushil |
| Solution 3 | Ali Raza |
| Solution 4 | ??????? ??????? |
