最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - fade out old element, fade in new - Stack Overflow

programmeradmin1浏览0评论

I am new to react and have tried react animations. They work great when elements are added or removed in a TransitionGroup. But if I replace a single element with a similar one, react detects that the content of that element has changed and does not trigger an animation.

How can I fade out a single element and fade in a new one in the same place? For example fade out login-div, fade in dashboard-div.

I am new to react and have tried react animations. They work great when elements are added or removed in a TransitionGroup. But if I replace a single element with a similar one, react detects that the content of that element has changed and does not trigger an animation.

How can I fade out a single element and fade in a new one in the same place? For example fade out login-div, fade in dashboard-div.

Share Improve this question asked Feb 19, 2014 at 8:46 barabara 3,0642 gold badges28 silver badges25 bronze badges 1
  • did u tried jquery animation on elements how its behave ? Can u provide some fiddle. – Neha Commented Feb 19, 2014 at 8:51
Add a ment  | 

1 Answer 1

Reset to default 6

If your elements have different key attributes, TransitionGroup will unmount one and mount the other.

You can read more about keys here: Composition vs Inheritance.

发布评论

评论列表(0)

  1. 暂无评论