Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/whole-paws-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@playcanvas/react": patch
---

Fix `shallowEquals` incorrectly returning early before checking all properties.
4 changes: 2 additions & 2 deletions packages/lib/src/utils/compare.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export const shallowEquals = (objA: Record<string, unknown>, objB: Record<string
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;
}
Expand Down