8000 Fix getContainer make container empty by nikogu · Pull Request #34 · react-component/notification · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix getContainer make container empty #34

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

Merged
merged 5 commits into from
Jan 11, 2018
Merged

Conversation

nikogu
Copy link
Contributor
@nikogu nikogu commented Jan 11, 2018

if (getContainer) {
div = getContainer();
const root = getContainer();
root.appendChild(div);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

跟 body 一样,创建一个节点作为容器。

const root = getContainer();
if (root) {
root.removeChild(div);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

销毁时的清理。

Copy link
Member

Choose a reason for hiding this comment

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

container.parentNode.removeChild(container);

getContainer() 返回的节点也可能是动态创建的。

Copy link
Member

Choose a reason for hiding this comment

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

也不需要判断 getContainer 了。

Copy link
Member

Choose a reason for hiding this comment

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

这里~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

有道理,我改下

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.7%) to 98.276% when pulling 9e4d13a on nikogu:master into 1882e82 on react-component:master.

@yesmeck
Copy link
Member
yesmeck commented Jan 11, 2018

测试

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.7%) to 98.276% when pulling 9e4d13a on nikogu:master into 1882e82 on react-component:master.

@nikogu
Copy link
Contributor Author
nikogu commented Jan 11, 2018

@yesmeck done

我再补充个销毁的好了

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 2682fca on nikogu:master into 1882e82 on react-component:master.

@nikogu
Copy link
Contributor Author
nikogu commented Jan 11, 2018

@yesmeck done!~

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 2cd4733 on nikogu:master into 1882e82 on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 4692c54 on nikogu:master into 1882e82 on react-component:master.

@yesmeck yesmeck merged commit 8af073b into react-component:master Jan 11, 2018
@yesmeck
Copy link
Member
yesmeck commented Jan 11, 2018

npm @benjycui @paranoidjk 才有权限

@paranoidjk
Copy link
Member

@yesmeck 给你加了

@yesmeck
Copy link
Member
yesmeck commented Jan 11, 2018

@nikogu 给你加了

@nikogu
Copy link
Contributor Author
nikogu commented Jan 11, 2018
8000

ok

@nikogu
Copy link
Contributor Author
nikogu commented Jan 11, 2018

@yesmeck @paranoidjk @benjycui npm 包有权限了,发了,但是 github 没权限 tag 没打上,你们谁加我下权限或者打个 3.0.1 的 tag(用当前 master 分支)

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.

4 participants
0