gpt4 book ai didi

react-native - react 原生不变违规 : requireNativeComponent: "RNCViewPager" was not found in the UIManager

转载 作者:行者123 更新时间:2023-12-04 11:27:05 26 4
gpt4 key购买 nike

我目前正在开发一个刚刚开始开发的小应用程序,但我不断收到此错误:

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)

我正在使用 import ScrollableTabView, { DefaultTabBar } from 'react-native-scrollable-tab-view';我想这是错误的来源,我在 stackoverflow 上进行了搜索,发现我必须安装 @react-native-community/viewpager,我这样做了,但在 Android 模拟器(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 <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>;
}

谢谢 !

最佳答案

请在终端中运行以下命令

=> npm i @react-native-community/viewpager

关于react-native - react 原生不变违规 : requireNativeComponent: "RNCViewPager" was not found in the UIManager,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59953648/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com