diff --git a/src/components/layout/Default.js b/src/components/layout/Default.js index a35e0873..23b5430d 100644 --- a/src/components/layout/Default.js +++ b/src/components/layout/Default.js @@ -38,7 +38,9 @@ class Default extends Component { componentDidUpdate(prevProps) { if (this.props.location !== prevProps.location) { - this._scrollContainer._scrollbar.scrollTo(0, 0) + if (this._scrollContainer) { + this._scrollContainer._scrollbar.scrollTo(0, 0) + } } } @@ -47,6 +49,7 @@ class Default extends Component { } _timeout = undefined + _scrollContainer = null render() { return (