Update useEffect dependency (#3239)

This commit is contained in:
akash-codemonk 2021-02-26 14:13:24 +05:30 committed by GitHub
parent dc146a1a16
commit 0682a92d87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,11 +106,11 @@ export const EditableText = (props: EditableTextProps) => {
useEffect(() => {
setIsEditing(!!props.isEditingDefault);
}, [props.defaultValue, props.isEditingDefault, setValue]);
}, [props.defaultValue, props.isEditingDefault]);
useEffect(() => {
if (props.forceDefault === true) setValue(props.defaultValue);
}, [props.forceDefault, props.defaultValue, setValue]);
}, [props.forceDefault, props.defaultValue]);
// at times onTextChange is not fired
// for example when the modal is closed on clicking the overlay