react-spring icon indicating copy to clipboard operation
react-spring copied to clipboard

[v9] Change spring config based on local state

Open aleclarson opened this issue 5 years ago • 0 comments

Trying to change spring config depending on the state, but there is some strange behavior.

Example 1. Expected behavior: on mount animation plays once and stops. Press "Start looping an animation" — animation begins its infinite loop. Then press "Stop looping an animation" — animation stops. Current behavior: on mount animation plays once and stops. Press "Start looping an animation" — animation begins its infinite loop. Then press "Stop looping an animation" — animation continue looping.

Example 2. Expected behavior: on mount animation plays infinite loop using "DEFAULT_ANIMATION_CONFIG". Press "Start playing" — animation plays infinite loop using PLAYING_ANIMATION_CONFIG. Then press "Stop playing" — animation plays infinite loop using "DEFAULT_ANIMATION_CONFIG". Current behavior: on mount animation plays infinite loop using "DEFAULT_ANIMATION_CONFIG". Press "Start playing" — animation plays infinite loop using PLAYING_ANIMATION_CONFIG. Then press "Stop playing" — animation is broken.

Originally posted by @bolotin-taptima in https://github.com/pmndrs/react-spring/issues/985#issuecomment-723808059

aleclarson avatar Nov 10 '20 22:11 aleclarson