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: fragment cache native node #1867

Merged
merged 3 commits into from
May 18, 2020

Conversation

yongningfu
Copy link
Collaborator

@yongningfu yongningfu commented May 4, 2020

fragment的native node 应该类似 composite 一样,应该是个只读的操作
之前的代码都是自上往下考虑 fragment的native node节点
但是fragment本身并不清楚子节点自身更新带来的native node的变化,从而造成内存泄露和bug

@yongningfu yongningfu requested review from wssgcg1213, andycall and yuanyan and removed request for wssgcg1213 and andycall May 4, 2020 10:02
@yongningfu yongningfu linked an issue May 4, 2020 that may be closed by this pull request
@chenjun1011 chenjun1011 self-assigned this May 12, 2020
@chenjun1011 chenjun1011 added this to the 20200514 milestone May 12, 2020
return [];
__getNativeNode() {
const renderedChildren = this.__renderedChildren || {};
return Array.prototype.concat.apply([], Object.keys(renderedChildren).map(key => renderedChildren[key].__getNativeNode()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Array.prototype 用 [] 替代会小一点

@yuanyan yuanyan merged commit 8f55dc4 into alibaba:master May 18, 2020
@imsobear imsobear mentioned this pull request May 21, 2020
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Cannot read property 'appendChild' of null
5 participants