From 7b0550c4f264352a5457fddfce8f3c4818b7ed83 Mon Sep 17 00:00:00 2001 From: roftLin <36958996+roftLin@users.noreply.github.com> Date: Fri, 25 Dec 2020 14:56:53 +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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Options.jsx b/src/Options.jsx index 5e5fd790..6f9435bf 100644 --- a/src/Options.jsx +++ b/src/Options.jsx @@ -12,9 +12,9 @@ class Options extends React.Component { }; getValidValue() { - const { goInputText, current } = this.state; + const { goInputText } = this.state; // eslint-disable-next-line no-restricted-globals - return !goInputText || isNaN(goInputText) ? current : Number(goInputText); + return !goInputText || isNaN(goInputText) ? undefined : Number(goInputText); } buildOptionText = (value) => `${value} ${this.props.locale.items_per_page}`;