[Gekidou MM-47486] Clear the search input after selecting a user (#6683)

This commit is contained in:
Jason Frerich
2022-10-20 05:54:00 -05:00
committed by GitHub
parent b90eaefcc0
commit 6b2d8ceff3

View File

@@ -90,7 +90,7 @@ const Search = forwardRef<SearchRef, SearchProps>((props: SearchProps, ref) => {
const onClear = useCallback(() => {
setValue('');
props.onClear?.();
}, []);
}, [props.onClear]);
const onChangeText = useCallback((text: string) => {
setValue(text);
@@ -105,8 +105,8 @@ const Search = forwardRef<SearchRef, SearchProps>((props: SearchProps, ref) => {
}), [theme]);
useEffect(() => {
setValue(props.defaultValue || value || '');
}, [props.defaultValue]);
setValue(props.defaultValue || props.value || '');
}, [props.defaultValue, props.value]);
const clearIcon = (
<CompassIcon