vydimitrov/use-count-up

React Native easing not supported?

Closed this issue · 3 comments

import { Easing } from 'react-native'

 <LazyCountUp
  isCounting
  easing={Easing.inOut(Easing.ease)}
  end={1200}
/>

Doesn't seem to work. The number goes negative, and ends at 1

Hey @Frexuz, the easing param expects a function that takes 4 arguments (numbers) and return a number - you can check it here and usage of it here. I'd suggest do not use ReactNative easing but instead use just JS easing. You can find your easing here and pass that function to the easing prop.

Well, the docs say that React Native is supported ;) Maybe the built in easing should work :) Shouldn't be hard to have an adapter, or function overloading :)

Yup, I pass all the values you need to build your own easing :)