From 8692aa9ec9d32e4c84a52e417e264396548c9676 Mon Sep 17 00:00:00 2001 From: emyarod Date: Mon, 25 Nov 2019 00:53:42 -0800 Subject: [PATCH] fix: destructure animation event handler --- packages/react/src/components/Copy/Copy.js | 5 +++-- packages/react/src/components/CopyButton/CopyButton.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/react/src/components/Copy/Copy.js b/packages/react/src/components/Copy/Copy.js index 13a6b1348b41..709ca8aa5a43 100644 --- a/packages/react/src/components/Copy/Copy.js +++ b/packages/react/src/components/Copy/Copy.js @@ -18,6 +18,7 @@ export default function Copy({ className, feedback, feedbackTimeout, + onAnimationEnd, onClick, ...other }) { @@ -44,8 +45,8 @@ export default function Copy({ if (event.animationName === 'hide-feedback') { setAnimation(''); } - if (other.handleAnimationEnd) { - other.handleAnimationEnd(event); + if (onAnimationEnd) { + onAnimationEnd(event); } }; diff --git a/packages/react/src/components/CopyButton/CopyButton.js b/packages/react/src/components/CopyButton/CopyButton.js index 48ea613cdfae..9631e70cbd5c 100644 --- a/packages/react/src/components/CopyButton/CopyButton.js +++ b/packages/react/src/components/CopyButton/CopyButton.js @@ -19,6 +19,7 @@ export default function CopyButton({ className, feedback, feedbackTimeout, + onAnimationEnd, onClick, ...other }) { @@ -45,8 +46,8 @@ export default function CopyButton({ if (event.animationName === 'hide-feedback') { setAnimation(''); } - if (other.handleAnimationEnd) { - other.handleAnimationEnd(event); + if (onAnimationEnd) { + onAnimationEnd(event); } };