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

skipAnimations breaks enter defined as function

Open kazdegroot opened this issue 3 years ago • 2 comments

🐛 Bug Report

When Globals.assign({ skipAnimation: true }); is used, an useTransition defining enter as a function will not have those changes applied, while one providing the same change as an object works fine.

To Reproduce

  1. Add an transition to a component with the enter prop set to a function (e.g. enter: () => async next => await next({opacity: 1}))
  2. See it work
  3. Set Globals.assign({ skipAnimation: true });
  4. See the transition no longer applying the styles.

Expected behavior

Have the end result be the same as when skipAnimation was false

Link to repro (highly encouraged)

https://codesandbox.io/s/awesome-vaughan-bdwcr

Has two components, one using a function enter, the other an object enter. Both work the same with skipAnimation false, the one using a function stops working when skipAnimation is true.

Environment

  • react-spring v9.1.1
  • react v17.0.2

kazdegroot avatar Apr 16 '21 13:04 kazdegroot

Hi there, I see this was removed from the 9.4.0 milestone a year ago and has been stale since. This issue prevents easily disable springs globally when users prefer reduced motion, as well as means spring animations have to run in realtime when testing in a pipeline. Is there any plan for picking this up in a coming version? Thanks

Runeii avatar May 17 '23 14:05 Runeii

Is there any plan for picking this up in a coming version

As a one person development team, I'm afraid to say no there isn't a plan to pick this up in the near future. ofc, anyone is welcome to submit a PR 😄

joshuaellis avatar May 17 '23 14:05 joshuaellis