Skip to content

useTransition does not run "leave" transition when delay is set #1662

@camurai

Description

@camurai

🐛 Bug Report

the useTransition hook does not run the "leave" transition if a delay is set. This can be seen in action on the "Toggle between components" example in the documentation for useTransition here: useTransition Documentation

The emoji abruptly disappears before the new one fades in, instead of slowly fading out as intended.

To Reproduce

copy the "Toggle between components" example from useTransition Documentation

Code Sandbox: https://codesandbox.io/s/zealous-wiles-tehw6?file=/src/App.js

if you remove the delay setting, the two will fade in and out as expected (though of course without the delay)

Expected behavior

smooth animated transition between the two components including a fade out.

Environment

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

Metadata

Metadata

Assignees

Labels

kind: bugSomething isn't workingreleased in betathis has been released on a beta

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions