callstack / react-native-pager-view

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

Fix child argument types in `addView` methods #857

Closed szydlovsky closed 1 month ago

szydlovsky commented 1 month ago

Summary

Fixes https://github.com/callstack/react-native-pager-view/issues/850 and https://github.com/callstack/react-native-pager-view/issues/856. As stated in the first issue, there seem to be unneeded nullabilities in child arguments for Android PagerViewManager (both paper and fabric). Their existence makes the methods override nothing, which in turn crashes the build.

Test Plan

Run on a fresh android app.

What's required for testing (prerequisites)?

Having anything react-native-pager-view related in the app.

What are the steps to reproduce (after prerequisites)?

You need to create 2 differents apps - one with RN 0.74, the other with RN 0.75 - to make sure we don't lose <0.75 compatibility. Then, after installing dependencies just try building via Android Studio.

Compatibility

OS Implemented
iOS not relevant
Android

Checklist

saif-o99 commented 1 month ago

Someone please accept this PR. its urgent fix

saif-o99 commented 1 month ago

there is also addView inside main/PagerViewViewManagerImpl.kt this this also needs to change?

szydlovsky commented 1 month ago

@troZee checked for RN 0.74.4 on both old and new arch - worked fine. 0.75.1 both arches work as well

szydlovsky commented 1 month ago

and yeah, PagerViewViewManagerImpl.kt might also need some tweaks I believe, but everything builds and works fine without it

szydlovsky commented 1 month ago

@troZee should I also add changes to the Implementation files?

hengkx commented 1 month ago

Thank you very much. When will the version be released