From 0ade7d02d638ae0c660f8815b5a02d8a70525957 Mon Sep 17 00:00:00 2001 From: Isaac Hudson Date: Mon, 11 May 2026 16:13:44 -0700 Subject: [PATCH 1/2] Fix issue with incorrectly returning too early --- packages/lib/src/utils/compare.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/lib/src/utils/compare.tsx b/packages/lib/src/utils/compare.tsx index 1391d5e0..b767ece9 100644 --- a/packages/lib/src/utils/compare.tsx +++ b/packages/lib/src/utils/compare.tsx @@ -54,8 +54,8 @@ type Equalable = { const propA = objA[key]; const propB = objB[key]; // If the object has an equality operator, use this - if(hasEqualsMethod(propA)) { - return propA.equals(propB); + if (hasEqualsMethod(propA) && !propA.equals(propB)) { + return false } else if (propA !== propB) { return false; } From 1c260abc022e32221f1f0e80e7737199da4b708d Mon Sep 17 00:00:00 2001 From: Isaac Hudson Date: Thu, 10 Sep 2026 16:45:51 -0700 Subject: [PATCH 2/2] chore: add changeset for shallowEquals fix --- .changeset/whole-paws-sort.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/whole-paws-sort.md diff --git a/.changeset/whole-paws-sort.md b/.changeset/whole-paws-sort.md new file mode 100644 index 00000000..0f44d3a7 --- /dev/null +++ b/.changeset/whole-paws-sort.md @@ -0,0 +1,5 @@ +--- +"@playcanvas/react": patch +--- + +Fix `shallowEquals` incorrectly returning early before checking all properties.