Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Feb 20, 2025
1 parent 756899f commit 5946ade
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ function useMemoizedBinding<
bindingValue !== ref.current.key.value ||
serializedBindingQuery !== ref.current.key.serializedQuery
) {
// This should not update the binding reference if the binding name, value, and query values are the same.
// Since query objects are immutable, we compare the serialized query string to make sure that we don't cause
// a re-render whenever a new query object with the same parameter values (QueryState) is passed in.
ref.current = {
key: {
name: bindingName,
Expand Down

0 comments on commit 5946ade

Please sign in to comment.