callstack / react-native-pager-view

React Native wrapper for the Android ViewPager and iOS UIPageViewController.
MIT License
2.66k stars 410 forks source link

web error: TypeError: Object(...) is not a function #333

Closed iamgouravturka closed 3 years ago

iamgouravturka commented 3 years ago

× TypeError: Object(...) is not a function Module.D:\project\React Native\RN-Test\node_modules\react-native-pager-view\lib\module\PagerViewNative.js D:/project/React Native/RN-Test/PagerViewNative.tsx:11 8 | getInnerViewNode(): ReactElement; 9 | } 10 |

11 | export const PagerViewViewManager = requireNativeComponent( 12 | VIEW_MANAGER_NAME 13 | ) as PagerViewViewManagerType; 14 |

troZee commented 3 years ago

Hello @iamgouravturka Could you provide more details ? I don't understand this error TBH

sindev95 commented 3 years ago

Hello @iamgouravturka Could you provide more details ? I don't understand this error TBH

on a brand new react native project , if you install react-native-pager-view and do the example provided and run on web/android/ios , you will get this error , i run into this issue myself now and im looking into it

troZee commented 3 years ago

viewpager does not support the web. More context here: https://github.com/callstack/react-native-pager-view/issues/91

phatnguyentan commented 1 year ago

I know it does not support web, but when I using it, it break all my app, although I exclude it: const isNative = Platform.OS !== "web"; {isNative && (PagerView here)

bkamrani commented 1 year ago

I know it does not support web, but when I using it, it break all my app, although I exclude it: const isNative = Platform.OS !== "web"; {isNative && (PagerView here)

@phatnguyentan have you found any solution or workaround for that? Many thanks!

bkamrani commented 1 year ago

I know it does not support web, but when I using it, it break all my app, although I exclude it: const isNative = Platform.OS !== "web"; {isNative && (PagerView here)

@phatnguyentan have you found any solution or workaround for that? Many thanks!

https://stackoverflow.com/questions/66928489/react-native-pagerview-webpack-typeerror-on-web/76790747#76790747

phatnguyentan commented 1 year ago

@bkamrani I used react-native-swiper: https://github.com/leecade/react-native-swiper