Skip to content

Commit

Permalink
fix motionDeadline miss element & bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Apr 25, 2020
1 parent cccb79e commit d3361ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rc-animate",
"version": "2.11.0",
"version": "2.11.1",
"description": "css-transition ui component for react",
"keywords": [
"react",
Expand Down
10 changes: 9 additions & 1 deletion src/CSSMotion.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,15 @@ export function genCSSMotion(config) {
};

getElement = () => {
return findDOMNode(this.node || this);
try {
return findDOMNode(this.node || this);
} catch (e) {
/**
* Fallback to cache element.
* This is only happen when `motionDeadline` trigger but element removed.
*/
return this.$cacheEle;
}
};

addEventListener = $ele => {
Expand Down

0 comments on commit d3361ef

Please sign in to comment.