callstack / react-native-pager-view

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

Support custom Spring Configurations #317

Open mrousavy opened 3 years ago

mrousavy commented 3 years ago

Describe the feature

I believe the native UIPageViewController supports custom spring configurations, so it would be nice to expose those to React Native. In my case, I want the spring animation a lot stiffer as it is currently a bit slow. It would be awesome to be able to configure this via the React component.

Another solution would be to simply expose the x value, which you can then animate using Reanimated - this requires little changes for this library and provides unlimited extensibility as we can now animate the x value as we wish (Reanimated.createAnimatedComponent(PagerView) then assign x to a SharedValue)

Motivation

Related Issues

troZee commented 1 year ago

Hey 👋 I believe the native UIPageViewController supports custom spring configurations

Unfortunately it does not. This is why we have a plan to rewrite whole pager native component to control an animation from JS perspective.