From 3d6d5f53a3068a93baa8e8adc7018c1ebd3f57df Mon Sep 17 00:00:00 2001 From: meriadec Date: Mon, 26 Feb 2018 10:06:15 +0100 Subject: [PATCH] Fix usage of this._scrollContainer in scrollbar --- src/components/layout/Default.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 (