Skip to content
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

fix(runtime-core): handle dynamic children for fragment #1154

Closed
wants to merge 1 commit into from

Conversation

underfin
Copy link
Member

@underfin underfin commented May 10, 2020

…nt in block fragment

fix #1153

the reason with bug: the dynamic children is [] when unmount fragment.

@@ -215,7 +214,7 @@ export function createBlock(
true /* isBlock: prevent a block from tracking itself */
)
// save current block children on the block vnode
vnode.dynamicChildren = currentBlock || EMPTY_ARR
vnode.dynamicChildren = currentBlock
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current block is Array for stable fragment .
The current block is null (openBlock(true)) for unkeyed or keyed fragment.
So only check dynamicChildren if it is null when patch or unmount.

@underfin underfin changed the title fix(runtime-core): should call onUnmounted hook with children compone… fix(runtime-core): handle dynamic children for fragment May 10, 2020
@yyx990803
Copy link
Member

See 5b8883a

dynamicChildren should always be non-null for block nodes since it's used to check if the vnode is actually a block.

@yyx990803 yyx990803 closed this May 11, 2020
@underfin underfin deleted the fix-1153 branch May 12, 2020 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

onUnmounted hook not called for components if their parent has been removed
2 participants