ahmed3mar / react-native-slick

The best Slick component for React Native.
MIT License
17 stars 13 forks source link

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

Open belal-mazlom opened 4 years ago

belal-mazlom commented 4 years ago

Which OS

Macos

Version

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 commented 4 years ago

I am getting the same error as well.

AbhishekNairOfficial commented 4 years ago

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

gauravkrp commented 4 years ago

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