diff --git a/src/root.jsx b/src/root.jsx index e4dfbbf..01e8dcc 100644 --- a/src/root.jsx +++ b/src/root.jsx @@ -12,9 +12,12 @@ class Root extends React.PureComponent { } componentDidUpdate () { - const tableWidth = this.dataTableRef.getBoundingClientRect().width; - if (this.renderedTableWidth !== tableWidth) { - this.forceUpdate(); + let tableWidth; + if (this.dataTableRef) { + tableWidth = this.dataTableRef.getBoundingClientRect().width; + if (this.renderedTableWidth !== tableWidth) { + this.forceUpdate(); + } } } @@ -66,7 +69,7 @@ class Root extends React.PureComponent { return (
{error ? ( -
+
{state.layout.errormessage}
) : (