Skip to content

Commit b747352

Browse files
authored
Fix race condition when unmounting
On `componentWillUnmount` if `container` is already deleted `removeChild` fails
1 parent 3282c29 commit b747352

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Layer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class LayerImpl extends React.Component {
2828
const { container } = this.state
2929
const { root, host, onUnmount } = this.props
3030
root && onUnmount && onUnmount(root)
31-
host && host.removeChild(container)
31+
host && container && host.removeChild(container)
3232
}
3333
render() {
3434
const { container } = this.state

0 commit comments

Comments
 (0)