mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-22 10:57:47 +00:00
fix(input, rn): add deps to input callbacks (#13683)
This commit is contained in:
@@ -80,31 +80,31 @@ const Input = forwardRef<TextInput, IProps>(({
|
||||
const { nativeEvent: { text } } = e;
|
||||
|
||||
onChange?.(text);
|
||||
}, []);
|
||||
}, [ onChange ]);
|
||||
|
||||
const clearInput = useCallback(() => {
|
||||
onChange?.('');
|
||||
}, []);
|
||||
}, [ onChange ]);
|
||||
|
||||
const handleBlur = useCallback((e: NativeSyntheticEvent<TextInputFocusEventData>) => {
|
||||
setFocused(false);
|
||||
onBlur?.(e);
|
||||
}, []);
|
||||
}, [ onBlur ]);
|
||||
|
||||
const handleFocus = useCallback((e: NativeSyntheticEvent<TextInputFocusEventData>) => {
|
||||
setFocused(true);
|
||||
onFocus?.(e);
|
||||
}, []);
|
||||
}, [ onFocus ]);
|
||||
|
||||
const handleKeyPress = useCallback((e: NativeSyntheticEvent<TextInputKeyPressEventData>) => {
|
||||
onKeyPress?.(e);
|
||||
}, []);
|
||||
}, [ onKeyPress ]);
|
||||
|
||||
const handleSubmitEditing = useCallback((e: NativeSyntheticEvent<TextInputSubmitEditingEventData>) => {
|
||||
const { nativeEvent: { text } } = e;
|
||||
|
||||
onSubmitEditing?.(text);
|
||||
}, []);
|
||||
}, [ onSubmitEditing ]);
|
||||
|
||||
return (<View style = { [ styles.inputContainer, customStyles?.container ] }>
|
||||
{label && <Text style = { styles.label }>{ label }</Text>}
|
||||
|
||||
Reference in New Issue
Block a user