Merge pull request #59 from unix/fix-portal

fix(use-portal): don't remove shared element slot
This commit is contained in:
witt
2020-04-06 11:06:00 +08:00
committed by GitHub

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