The time returned by performance-now, which was used in componentDidMount and componentWillReceiveProps lifecycle functions to reset the animation, can be greater than the timestamp of requestAnimationFrame (raf) callback. Thus we got negative values for timeDelta. By initializing and resetting prevTime with null instead and setting it to to the timestamp of the first requestAnimationFrame callback, we can prevent negative values.
The time returned by performance-now, which was used in
componentDidMount
andcomponentWillReceiveProps
lifecycle functions to reset the animation, can be greater than the timestamp ofrequestAnimationFrame
(raf) callback. Thus we got negative values fortimeDelta
. By initializing and resettingprevTime
with null instead and setting it to to the timestamp of the firstrequestAnimationFrame
callback, we can prevent negative values.fixes #453