Skip to content

Conversation

@berkant37
Copy link

Description

useDeepCompareEffect currently shows a warning when all dependencies are primitive values.
This also affects the common case where there is only a single primitive dependency, where deep comparison is harmless and the warning becomes confusing.

This change relaxes the warning logic:

  • Warns only when multiple primitive dependencies are used
  • Does not warn when there is a single primitive dependency
  • Existing behavior remains unchanged

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I performed a self-review of the code
  • Tests added / updated where applicable
  • All tests pass (npm test)

Related issue

Fixes #755

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove warnings from useDeepCompareEffect

2 participants