Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #50
缘由
motionDeadline
会在 active 态一下增加一个计时器,当时间到时则触发一次 fallback motionEnd 事件。motionEnd 事件会检测当前的动画状态是否是 Appear or Enter or Leave 之一。当 DOM 元素的动画被正确触发时,由于 status 被重置为none
所以会跳过兜底事件。但是虽然事件会跳过,获取 DOM 元素的检测还是在逻辑中的。这导致了 DOM 被删除后被降级为
findDOMNode
,从而触发了 React warning。修复方式
在使用 getDOM 的地方提前检测一下
status
是否是none
,如果已经是了则直接跳过。提前进行短路。