小编j S*_* SO的帖子

React Native Invariant Violation: requireNativeComponent: "RNCViewPager" was not found in the UIManager

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

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)
Run Code Online (Sandbox Code Playgroud)

我正在使用 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 }} …
Run Code Online (Sandbox Code Playgroud)

react-native

5
推荐指数
5
解决办法
3229
查看次数

标签 统计

react-native ×1