From c3caca9210c6ccca5e336af4e5270e1bdb1b5913 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Mon, 17 Dec 2018 17:23:55 -0800 Subject: [PATCH] Make TextInput event prop types less strict (#22673) Summary: Similar to what was done here https://github.com/facebook/react-native/pull/22376 This allows using things like async functions with text input event props. Changelog: ---------- [General] [Fixed] - Make TextInput event prop types less strict Pull Request resolved: https://github.com/facebook/react-native/pull/22673 Reviewed By: TheSavior Differential Revision: D13492029 Pulled By: hramos fbshipit-source-id: 84e1a776a7ac1ae7567fbf4105b2be9be330610e --- Libraries/Components/TextInput/TextInput.js | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index 84da712b4ec..729bf2e529e 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -247,17 +247,17 @@ type Props = $ReadOnly<{| returnKeyType?: ?ReturnKeyType, maxLength?: ?number, multiline?: ?boolean, - onBlur?: ?(e: BlurEvent) => void, - onFocus?: ?(e: FocusEvent) => void, - onChange?: ?(e: ChangeEvent) => void, - onChangeText?: ?(text: string) => void, - onContentSizeChange?: ?(e: ContentSizeChangeEvent) => void, - onTextInput?: ?(e: TextInputEvent) => void, - onEndEditing?: ?(e: EditingEvent) => void, - onSelectionChange?: ?(e: SelectionChangeEvent) => void, - onSubmitEditing?: ?(e: EditingEvent) => void, - onKeyPress?: ?(e: KeyPressEvent) => void, - onScroll?: ?(e: ScrollEvent) => void, + onBlur?: ?(e: BlurEvent) => mixed, + onFocus?: ?(e: FocusEvent) => mixed, + onChange?: ?(e: ChangeEvent) => mixed, + onChangeText?: ?(text: string) => mixed, + onContentSizeChange?: ?(e: ContentSizeChangeEvent) => mixed, + onTextInput?: ?(e: TextInputEvent) => mixed, + onEndEditing?: ?(e: EditingEvent) => mixed, + onSelectionChange?: ?(e: SelectionChangeEvent) => mixed, + onSubmitEditing?: ?(e: EditingEvent) => mixed, + onKeyPress?: ?(e: KeyPressEvent) => mixed, + onScroll?: ?(e: ScrollEvent) => mixed, placeholder?: ?Stringish, placeholderTextColor?: ?ColorValue, secureTextEntry?: ?boolean,