-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
fix(renderer): fix patch error in unstable slot #9202
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
Conversation
Size ReportBundles
Usages
|
please add unit test |
n1.dynamicChildren | ||
n1.dynamicChildren && | ||
// #9200 in some case stable fragment in deep unstable slot | ||
n1?.children?.length === n2?.children?.length |
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.
We should avoid using optional chaining #4882 (comment)
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.
removed optional chaining
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.
avoid using optional chaining
n1.dynamicChildren | ||
n1.dynamicChildren && | ||
// #9200 in some case stable fragment in deep unstable slot | ||
n1?.children?.length === n2?.children?.length |
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.
n1?.children?.length === n2?.children?.length | |
dynamicChildren.length === n1.dynamicChildren.length |
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.
fixed
added unit test |
8a48ff5
to
3ec274b
Compare
@@ -351,4 +355,121 @@ describe('renderer: fragment', () => { | |||
render(renderFn(['two', 'one']), root) | |||
expect(serializeInner(root)).toBe(`text<div>two</div>text<div>one</div>`) | |||
}) | |||
|
|||
// #9200 | |||
test('stable fragment in unstable slot', () => { |
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 test case is too complex to understand.
here is a simple one
@linghaoSu |
fix #9200
live demo