React-native-swiper: Facing error of ViewPager while using Swiper

Created on 27 Sep 2019  路  6Comments  路  Source: leecade/react-native-swiper

Which OS ?

Version

Which versions are you using:

  • react-native-swiper v?
  • react-native v0.?.?

Expected behaviour

Actual behaviour

How to reproduce it>

To help us, please fork this component, modify one example in examples folder to reproduce your issue and include link here.
-

Steps to reproduce

1.
2.
3.

No Template

Most helpful comment

A quick workaround is that
Install and auto link npm i @react-native-community/viewpager

then run react-native run-android

Go to node_modules\react-native-swiper\src\index.js and

remove ViewPagerAndroid import from 'react-native' and add this import ViewPager from "@react-native-community/viewpager";

and then at line 652 of index.js replace <ViewPagerAndroid /> with <ViewPager/>

It works for me

All 6 comments

if you are using latest react native version view pager is deprecated, you have to install it from @react-native-community/react-native-viewpager.

otherwise install npm i react-native-swiper@next , this is based on ScrollView, so you can able to resolve view pager error, but this is still not a stable version. there may be some bugs.

A quick workaround is that
Install and auto link npm i @react-native-community/viewpager

then run react-native run-android

Go to node_modules\react-native-swiper\src\index.js and

remove ViewPagerAndroid import from 'react-native' and add this import ViewPager from "@react-native-community/viewpager";

and then at line 652 of index.js replace <ViewPagerAndroid /> with <ViewPager/>

It works for me

Can confirm that the above fix works. This should be branched and then pull requested.

Hi there, I have updated to ^1.6.0-rc.3 but I am still getting the error on ViewPagerAndroid !!

UPDATE

removing and re-installing node_modules did the trick

Node_modules removing and re-installing was not enough for me:
https://github.com/leecade/react-native-swiper/issues/1108#issuecomment-555037592

@henkkasoft Maybe you forgot, the closing ViewPagerAndroid tag after updating the ViewPagerAndroid tag to just ViewPager.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

itinance picture itinance  路  3Comments

Liqiankun picture Liqiankun  路  3Comments

commit-master picture commit-master  路  3Comments

AndriiBoiko picture AndriiBoiko  路  3Comments

tokict picture tokict  路  3Comments