ptomasroos / react-native-scrollable-tab-view

Tabbed navigation that you can swipe between, each tab can have its own ScrollView and maintain its own scroll position between swipes. Pleasantly animated. Customizable tab bar
https://www.npmjs.com/package/react-native-scrollable-tab-view
6.93k stars 2.28k forks source link

android error Check the render method of `AnimatedComponent` #1133

Open yanhongchang-1105 opened 3 years ago

yanhongchang-1105 commented 3 years ago

Steps to Reproduce

Expected Behavior

Actual Behavior

ahmetozalp commented 3 years ago

Did you solve the problem?

CloudComputing-linux commented 3 years ago

查看错误日志发现是1.0版本使用的语法是require的方式引入。后来发现react-native-scrollable-tab-view 中引入了: @react-native-community/viewpager 所以进入react-native-scrollable-tab-view 源码; 把index.js中的 const ViewPager = require('@react-native-community/viewpager'); 改成:import ViewPager from '@react-native-community/viewpager'; 这样就可以了,希望作者可以看到修改一下

hungdev commented 3 years ago

i faced the same problem, and i solved the problem by installing:

"@react-native-community/viewpager": "^3.3.0",
"react-native-scrollable-tab-view": "git+https://github.com/ptomasroos/react-native-scrollable-tab-view.git",
yz1311 commented 3 years ago

It caused by '@react-native-community/viewpager' version. Here are two solutions:

hunao0221 commented 3 years ago

查看错误日志发现是1.0版本使用的语法是require的方式引入。后来发现react-native-scrollable-tab-view 中引入了: @react-native-community/viewpager 所以进入react-native-scrollable-tab-view 源码; 把index.js中的 const ViewPager = require('@react-native-community/viewpager'); 改成:import ViewPager from '@react-native-community/viewpager'; 这样就可以了,希望作者可以看到修改一下

thanks a lot, works for me.

crush12132 commented 3 years ago

您好!我在运行移动端代码时显示Check the render method of AnimatedComponent,import {ScrollView,SafeAreaView,TouchableOpacity,Animated} from 'react-native',也使用到 const AnimatedContainer = Animated.createAnimatedComponent(Container) 但是显示了这个错误。我按照您的方法进行修改但好像没有找到对应的 const ViewPager = require('@react-native-community/viewpager'); 并且我使用的是ScrollView,而不是ViewPager,请问有什么方法可以解决吗?

fukemy commented 2 years ago

It caused by '@react-native-community/viewpager' version. Here are two solutions:

  • 1.downgrade '@react-native-community/viewpager' version to 3.3.0
  • 2.change react-native-scrollable-tab-view/index.js code:
let ViewPager = require('@react-native-community/viewpager');
if(typeof ViewPager === 'object' && typeof ViewPager.default === 'function') {
  ViewPager = ViewPager.default;
}

I test it in both @react-native-community/viewpager version 3.3.0 and 5.0.11 or just use my package @yz1311/react-native-scrollable-tab-view (>=1.0.6)

im used method 2, but my tabbar can not swipe

NguyenLuongVinh commented 1 year ago

It caused by '@react-native-community/viewpager' version. Here are two solutions:

  • 1.downgrade '@react-native-community/viewpager' version to 3.3.0
  • 2.change react-native-scrollable-tab-view/index.js code:
let ViewPager = require('@react-native-community/viewpager');
if(typeof ViewPager === 'object' && typeof ViewPager.default === 'function') {
  ViewPager = ViewPager.default;
}

I test it in both @react-native-community/viewpager version 3.3.0 and 5.0.11 or just use my package @yz1311/react-native-scrollable-tab-view (>=1.0.6)

thanks a lot, works for me.