{{ message }}
Repository navigation
fix(react): use Object.is instead of === in defaultCompare - #298
Open
alex-js-ltd wants to merge 8 commits into
Open
alex-js-ltd wants to merge 8 commits into
alex-js-ltd wants to merge 8 commits into
Conversation
Contributor
|
View your CI Pipeline Execution ↗ for commit bded194
☁️ Nx Cloud last updated this comment at |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/pr.yml:
- Around line 13-16: Remove the workflow-wide "issues: write" entry from the
permissions block (the permissions key containing "contents: read",
"pull-requests: write", and "issues: write") so only minimal privileges remain
(keep "contents: read" and "pull-requests: write"); if a future action actually
requires issue write access, grant "issues: write" at the specific job or step
scope instead of workflow-wide to minimize privileges.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🎯 Changes
defaultCompareuses===for equality checks which has two edge case failures:NaN === NaNreturnsfalse, causing spurious re-renders when state holdsNaN+0 === -0returnstrue, swallowing a legitimate state update🔧 Fix
Replace
===withObject.is, which handles both cases correctly and alignswith how React handles equality internally in
useState,useMemoanduseEffect.✅ Checklist
pnpm test:pr.🚀 Release Impact
Summary by CodeRabbit