Skip to content

CSSTransitionGroup does not animate if child calls getBoundingClientRect() on componentDidMount #3672

Closed
@shaharz

Description

@shaharz

Possibly not a React bug, but I haven't been able to reproduce in vanilla JS/HTML/CSS so far.

Demo: http://jsfiddle.net/cjqg0y48/1/

I encountered this when I tried to fade in a component that contains react-swipe which uses a plain JS library under the hood. It seems like the call it makes to getBoundingClientRect() magically neutralizes the transition, causing it to have no effect.

One workaround seems to be deferring the getBoundingClientRect() call using setTimeout. (Thanks GreenJello on #reactjs)

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