[bug]: Different configs per property not possible in useTransition()

Author: hatsumatsuCreated Apr 3, 2023Updated Jun 11, 2026
Labelskind: bugarea: corerelease: major

Which react-spring target are you using?

  • @react-spring/web
  • @react-spring/three
  • @react-spring/native
  • @react-spring/konva
  • @react-spring/zdog

What version of react-spring are you using?

9.6.0

What's Wrong?

When using useTransition it does not seem to be possible to have different spring configs per property like stated in https://www.react-spring.dev/docs/advanced/config#config-per-springvalue .

To Reproduce

Consider this simple transition:

javascript
const transitions = useTransition(data, {
    from: { opacity: 0, y: 2 },
    enter: { opacity: 1, y: 0 },
    leave: { opacity: 0, y: -2 },
    config: (key) => {
        return key === 'y' config.wobbly : { duration: 600 };
    },
});

https://www.react-spring.dev/docs/advanced/config#config-per-springvalue states that a function-based config has access to the key of the animated property. In case of useTransition() the passed variable holds the value of data.

Expected Behaviour

We have access to the property key in function-based configs.

Link to repo

_