clarify variable naming

This commit is contained in:
Konstantin Schaper
2020-09-10 11:26:47 +02:00
parent 4c274bdc59
commit d32a2f1490

View File

@@ -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<Props, State> {
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 || ""
});
}
};