diff --git a/scm-ui/ui-components/src/forms/FilterInput.tsx b/scm-ui/ui-components/src/forms/FilterInput.tsx index c891ffd786..fad1611c00 100644 --- a/scm-ui/ui-components/src/forms/FilterInput.tsx +++ b/scm-ui/ui-components/src/forms/FilterInput.tsx @@ -21,10 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -import React, {ChangeEvent, FormEvent} from "react"; -import {WithTranslation, withTranslation} from "react-i18next"; +import React, { ChangeEvent, FormEvent } from "react"; +import { WithTranslation, withTranslation } from "react-i18next"; import styled from "styled-components"; -import {createAttributesForTesting} from "../devBuild"; +import { createAttributesForTesting } from "../devBuild"; type Props = WithTranslation & { filter: (p: string) => void; @@ -59,12 +59,12 @@ class FilterInput extends React.Component { event.preventDefault(); }; - componentDidUpdate = (prevProps: Props) => { - const { value } = this.props; + componentDidUpdate = ({ value: oldValue }: Props) => { + const { value: newValue } = this.props; const { value: stateValue } = this.state; - if (prevProps.value !== value && value !== stateValue) { + if (oldValue !== newValue && newValue !== stateValue) { this.setState({ - value: value || "" + value: newValue || "" }); } };