Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Error by ViewPagerAndroid that's removed from RN 0.61 #5

Open
belal-mazlom opened this issue Oct 13, 2019 · 3 comments
Open

Error by ViewPagerAndroid that's removed from RN 0.61 #5

belal-mazlom opened this issue Oct 13, 2019 · 3 comments

Comments

@belal-mazlom
Copy link

Which OS

Macos

Version

  • react-native-slick v1.0.2
  • react-native v0.61.1

Expected behaviour

No errors on Android

Actual behaviour

Current version raise error for "ViewPagerAndroid"

Error details:
Invariant Violation: VoewPagerAndroid has been removed from React Native.
It can now be installed and imported from 'react-native-viewpager' instead of 'react-native'

How to reproduce it>

It will only appear in Android platform

@domhacking
Copy link

I am getting the same error as well.

@AbhishekNairOfficial
Copy link

I'm also getting the same error.
Is someone working on RN 0.61 support?

@gauravkrp
Copy link

gauravkrp commented Feb 6, 2020

This library is using 'ViewPagerAndroid' which earlier came included with 'react-native' package BUT is now separated and can be used as an external library. You need to install it from - https://www.npmjs.com/package/@react-native-community/viewpager

Then after installing them, go to the folder - node_modules/react-native-slick/src and open index.js file. There you will see that it is importing ViewPagerAndroid from 'react-native'.
Remove that and add a new import - import ViewPagerAndroid from '@react-native-community/viewpager' . See the screenshot for help.
That's it! You slider will work.

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants