From 841b53b8bf51d5a1abaffd2fddd860c6b1fe605c Mon Sep 17 00:00:00 2001 From: Nick Graef <1031317+ngraef@users.noreply.github.com> Date: Mon, 26 Feb 2024 18:50:03 -0600 Subject: [PATCH] fix new object comparison logic bug Resolves #88 --- src/Animate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Animate.js b/src/Animate.js index 7f1bbc9..a687698 100644 --- a/src/Animate.js +++ b/src/Animate.js @@ -97,7 +97,7 @@ class Animate extends PureComponent { const newState = { style: attributeName ? { [attributeName]: from } : from, }; - if ((attributeName && [attributeName] !== from) || (!attributeName && style !== from)) { + if ((attributeName && style[attributeName] !== from) || (!attributeName && style !== from)) { // eslint-disable-next-line react/no-did-update-set-state this.setState(newState); }