Skip to content

Commit

Permalink
Properly checks if the new value is the same as the previous one
Browse files Browse the repository at this point in the history
The prior implementation would always compare the previous with itself
  • Loading branch information
pirelenito committed Jul 25, 2024
1 parent da13cc1 commit f1bc2db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@react-facet/core/src/hooks/useFacetUnwrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function useFacetUnwrap<T extends Value>(
return { value }
}

if (previousValue !== NO_VALUE && isEqual(previousValue)) {
if (previousValue !== NO_VALUE && isEqual(value)) {
return previousState
}

Expand Down

0 comments on commit f1bc2db

Please sign in to comment.