mirror of
https://github.com/zhigang1992/react.git
synced 2026-04-28 20:25:29 +08:00
fix: remove node when component unmount
This commit is contained in:
@@ -25,7 +25,7 @@ const usePortal = (selectId: string = getId()): Element | null => {
|
||||
return () => {
|
||||
const node = document.getElementById(id)
|
||||
if (node) {
|
||||
// document.body.removeChild(node)
|
||||
document.body.removeChild(node)
|
||||
}
|
||||
}
|
||||
}, [])
|
||||
|
||||
Reference in New Issue
Block a user