From 167a4248b5880192742778a7440c204e48205374 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 11 May 2020 19:29:22 -0700 Subject: [PATCH] Makes loading page timer a non-state var, fixes this.setState call Surprised I didn't catch this earlier - my fault! --- src/components/common/LoadingPage.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/common/LoadingPage.js b/src/components/common/LoadingPage.js index 7f5e312f..3517462b 100644 --- a/src/components/common/LoadingPage.js +++ b/src/components/common/LoadingPage.js @@ -16,18 +16,18 @@ class Loading extends React.Component { super(props); this.state = { showHelpText: !!this.props.showHelpText, - timer: 0, }; + this.timer = false; } componentDidMount = () => { - this.setState.timer = setTimeout(() => { - this.setState({ showHelpText: true }); + this.timer = setTimeout(() => { + this.setState({ showHelpText: true }); }, 2000); - }; + } componentWillUnmount = () => { - clearTimeout(this.setState.timer); - }; + clearTimeout(this.timer); + } render = () => { return (