Fixed isEqual register initalization#1033
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 0eb8e6f:
|
0eb8e6f to
486029e
Compare
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/useField.ts (1)
30-30: 🧹 Nitpick | 🔵 TrivialRemove unused
defaultIsEqualconstant.
defaultIsEqualis no longer referenced after the change on line 93 whereisEqualis now passed directly fromconfigRef.current.isEqual.♻️ Proposed fix
-const defaultIsEqual = (a: any, b: any): boolean => a === b; -
Remove the unnecessary
isEqualfunction definition. This was necessary because #1032 is fixed by updating the fieldisEqualevery timeregisterFieldis called. This fix relies on the fact thatisEqualis only defined when necessary which this change does.Summary by CodeRabbit