-
Notifications
You must be signed in to change notification settings - Fork 801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proper children reconcile for nested tags #871
Conversation
@@ -129,17 +129,19 @@ const mapChildren = (children, instances) => ({ | |||
} | |||
} | |||
|
|||
const newChildren = asArray((child.props && child.props.children) || []) | |||
const newChildren = asArray( | |||
(child.props && child.props.children) || child.children || [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When result of this function on next render iteration got in here again - it will be just ignored.
That was the first problem.
// the children from an instance or rendered children | ||
// while children from a props is just a props. | ||
// they could not exists. they could differ. | ||
...(nextChildren ? { children: nextChildren } : {}), | ||
...(nextChildren || {}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a second. A little "gap" in the tree
@@ -213,12 +213,50 @@ describe('reconciler', () => { | |||
|
|||
incrementGeneration() | |||
wrapper.setProps({ update: 'now' }) | |||
expect(First.rendered).toHaveBeenCalledTimes(4) | |||
expect(First.rendered).toHaveBeenCalledTimes(3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means - fixed!
Codecov Report
@@ Coverage Diff @@
## next #871 +/- ##
==========================================
+ Coverage 87.22% 87.38% +0.15%
==========================================
Files 30 30
Lines 634 634
Branches 149 148 -1
==========================================
+ Hits 553 554 +1
+ Misses 65 64 -1
Partials 16 16
Continue to review full report at Codecov.
|
Proper children reconcile for nested tags, fixes #869
The way a change the tests indicates that problem was fixed.