From 435ebc19a15cdf79c47e536f990d60c18cb90d07 Mon Sep 17 00:00:00 2001 From: roftLin <36958996+roftLin@users.noreply.github.com> Date: Fri, 25 Dec 2020 16:13:15 +0800 Subject: [PATCH] Update Options.jsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这个组件并没有current状态(某个版本改动导致),对应的逻辑应该重新调整,更符合实际情况。 --- src/Options.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Options.jsx b/src/Options.jsx index 5e5fd790..740a5488 100644 --- a/src/Options.jsx +++ b/src/Options.jsx @@ -12,7 +12,8 @@ class Options extends React.Component { }; getValidValue() { - const { goInputText, current } = this.state; + const { goInputText } = this.state; + const { current } = this.props; // eslint-disable-next-line no-restricted-globals return !goInputText || isNaN(goInputText) ? current : Number(goInputText); }