Skip to content
Snippets Groups Projects
Unverified Commit d58cb8a6 authored by Oisin Coveney's avatar Oisin Coveney Committed by GitHub
Browse files

Fix unmounted node error on ExplicitSize (#42766)

parent 0147c695
Branches
Tags
No related merge requests found
......@@ -77,11 +77,16 @@ function ExplicitSize<T extends BaseInnerProps>({
}
_getElement() {
let element = ReactDOM.findDOMNode(this);
if (selector && element instanceof Element) {
element = element.querySelector(selector) || element;
try {
let element = ReactDOM.findDOMNode(this);
if (selector && element instanceof Element) {
element = element.querySelector(selector) || element;
}
return element instanceof Element ? element : null;
} catch (e) {
console.error(e);
return null;
}
return element instanceof Element ? element : null;
}
componentDidMount() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment