Skip to content

DOM Element Not Removed After Animation #215

@mathewbyrne

Description

@mathewbyrne

When animating out an unmounted element with Transition, the DOM elements are not removed after the animation.

Now unfortunately I cannot isolate and reproduce this issue. Here is a sandbox with an attempt to isolate, however the DOM elements are removed after the animation — https://codesandbox.io/s/oooxx0njl6

Here is the code snippet from the application:

<Transition
    native
    from={{ opacity: 0 }}
    enter={{ opacity: 1 }}
    leave={{ opacity: 0 }}
>
    {this.state.display &&
        (style => (
            <animated.div style={style}>
                <a onClick={() => this.setState({ displayBriefs: false })}>Back</a>
            </animated.div>
        ))}
</Transition>

And lastly here is an animation showing the issue from our application:

There look to be a few related issues, I've definitely seen #211 and #134 occurring with this setup. Seems similar to #43 which was resolved in a previous version.

We're using react-spring: ^5.6.9 and react: ^16.4.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions