-
Notifications
You must be signed in to change notification settings - Fork 115
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
Conversation
if (getContainer) { | ||
div = getContainer(); | ||
const root = getContainer(); | ||
root.appendChild(div); |
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.
跟 body 一样,创建一个节点作为容器。
src/Notification.jsx
Outdated
const root = getContainer(); | ||
if (root) { | ||
root.removeChild(div); | ||
} |
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.
销毁时的清理。
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.
container.parentNode.removeChild(container);
getContainer()
返回的节点也可能是动态创建的。
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.
也不需要判断 getContainer
了。
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.
这里~
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.
有道理,我改下
测试 |
我再补充个销毁的好了 |
@yesmeck done!~ |
npm @benjycui @paranoidjk 才有权限 |
@yesmeck 给你加了 |
@nikogu 给你加了 |
ok |
@yesmeck @paranoidjk @benjycui npm 包有权限了,发了,但是 github 没权限 tag 没打上,你们谁加我下权限或者打个 3.0.1 的 tag(用当前 master 分支) |
ant-design/ant-design#8906