From 7b09eb54e7ecdde91cb4748dc26207dd05088382 Mon Sep 17 00:00:00 2001 From: Nadiia D Date: Mon, 22 Feb 2021 18:27:23 -0800 Subject: [PATCH] Use flow strict-local Summary: Changelog: [General][Changed] TextInput: use flow strict-local Reviewed By: kacieb Differential Revision: D26573763 fbshipit-source-id: 9d7d48310dd41949d07ad7616c4713b521c2545d --- Libraries/Components/TextInput/TextInput.js | 30 +++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index 62fda5a726b..39967a67111 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -4,12 +4,10 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow + * @flow strict-local * @format */ -'use strict'; - const DeprecatedTextInputPropTypes = require('../../DeprecatedPropTypes/DeprecatedTextInputPropTypes'); const Platform = require('../../Utilities/Platform'); const React = require('react'); @@ -869,13 +867,14 @@ function InternalTextInput(props: Props): React.Node { selection = null; } - let viewCommands: TextInputNativeCommands>; + let viewCommands; if (AndroidTextInputCommands) { viewCommands = AndroidTextInputCommands; } else { - viewCommands = props.multiline - ? RCTMultilineTextInputNativeCommands - : RCTSinglelineTextInputNativeCommands; + viewCommands = + props.multiline === true + ? RCTMultilineTextInputNativeCommands + : RCTSinglelineTextInputNativeCommands; } const text = @@ -1089,13 +1088,15 @@ function InternalTextInput(props: Props): React.Node { const {onBlur, onFocus, ...eventHandlers} = usePressability(config) || {}; if (Platform.OS === 'ios') { - const RCTTextInputView = props.multiline - ? RCTMultilineTextInputView - : RCTSinglelineTextInputView; + const RCTTextInputView = + props.multiline === true + ? RCTMultilineTextInputView + : RCTSinglelineTextInputView; - const style = props.multiline - ? [styles.multilineInput, props.style] - : props.style; + const style = + props.multiline === true + ? [styles.multilineInput, props.style] + : props.style; textInput = ( 1) { @@ -1222,6 +1223,7 @@ const styles = StyleSheet.create({ }, }); +// $FlowFixMe[unclear-type] Unclear type. Using `any` type is not safe. module.exports = ((ExportedForwardRef: any): React.AbstractComponent< React.ElementConfig, $ReadOnly<{|