fix(use-portal): don't remove shared element slot when component destroyed

This commit is contained in:
unix
2020-04-06 11:01:47 +08:00
parent 36e9cac3c9
commit be62359d01

View File

@@ -21,13 +21,6 @@ const usePortal = (selectId: string = getId()): HTMLElement | null => {
document.body.appendChild(el)
}
setElSnapshot(el)
return () => {
const node = document.getElementById(id)
if (node) {
document.body.removeChild(node)
}
}
}, [])
return elSnapshot