Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native "this._easing is not a function" with v0.20

I am running into this error on certain pages and not all but can't track it down to anything in my code.

Red Error Modal from simulator:

this._easing is not a function. (In 'this._easing((now-this._startTime)/this.duration)', 'this._easing is NaN')


onUpdate
AnimatedImplementation.js @ 216:8

CallTimer

callTimers

__callFunction

<unknown>

guard

CallFunctionreturnFlusedQueue

Have upgrading project to v0.20, cleaned xcode's build/run and rn bundles just in case. I'm fairly sure my code isn't using the animation libraries too.

like image 437
Labithiotis Avatar asked Feb 27 '16 15:02

Labithiotis


1 Answers

This is an older post, but I found this through Google so hoping this may help some others out there.

For bounce and ease easings, you don't need to invoke the function if you're not modifying the default params.

// this should error
Animated.timing(this.state.animatedValue, {
  toValue: 10,
  duration: 300,
  easing: Easing.bounce()
}).start();

If you just pass the reference to bounce instead, the error will go away.

easing: Easing.bounce
like image 109
BradByte Avatar answered Oct 18 '22 03:10

BradByte