Open
Conversation
The rule against nesting of hook calls requires us to change the structure of this code somewhat.
If the child components of <Field> check for reference equality of their props to decide to re-render, the old code was causing excessive re-renders by changing the identity of input and meta props.
Codecov Report
@@ Coverage Diff @@
## master #640 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 17 17
Lines 251 257 +6
Branches 58 57 -1
=====================================
+ Hits 251 257 +6
Continue to review full report at Codecov.
|
Contributor
Author
|
Note on second glance - because of extensive whitespace changes, the diffs are best viewed with |
Member
|
Can you show me a render counting test that passes if |
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.
Preventing unnecessary re-renders is the name of the game. Users will only see gains if they pass in a pure/memoized component, but if they do it's a big difference.