From 66c6a75650f91d61e7e87a8e661d87101e26cf9c Mon Sep 17 00:00:00 2001 From: Pieter Vanderwerff Date: Thu, 23 Jun 2022 16:54:29 -0700 Subject: [PATCH] Suppress missing annotations in xplat/js Summary: Add annotations to function parameters required for Flow's Local Type Inference project. This codemod prepares the codebase to match Flow's new typechecking algorithm. The new algorithm will make Flow more reliable and predictable. Reviewed By: bradzacher Differential Revision: D37388949 fbshipit-source-id: cdcbc98035ce9b6994842005ea46df42de54f9b8 --- Libraries/Alert/Alert.js | 2 ++ .../DrawerAndroid/DrawerLayoutAndroid.android.js | 4 ++++ Libraries/Components/Pressable/Pressable.js | 2 ++ Libraries/Components/ScrollView/ScrollView.js | 2 ++ Libraries/Components/ScrollView/ScrollViewStickyHeader.js | 2 ++ Libraries/Components/Touchable/PooledClass.js | 2 ++ Libraries/Components/Touchable/TouchableNativeFeedback.js | 8 ++++++-- Libraries/Core/ExceptionsManager.js | 2 ++ Libraries/Core/setUpBatchedBridge.js | 2 ++ Libraries/Image/Image.android.js | 2 ++ Libraries/Image/Image.ios.js | 2 ++ Libraries/Lists/SectionList.js | 2 ++ Libraries/Lists/VirtualizedList.js | 4 ++++ Libraries/LogBox/LogBox.js | 2 ++ Libraries/LogBox/UI/AnsiHighlight.js | 2 ++ .../__tests__/StaticViewConfigValidator-test.js | 4 ++++ Libraries/Pressability/__tests__/Pressability-test.js | 2 ++ Libraries/Storage/AsyncStorage.js | 2 ++ Libraries/Utilities/__tests__/useMergeRefs-test.js | 2 ++ Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js | 2 ++ ReactAndroid/src/androidTest/js/UIManagerTestModule.js | 2 ++ .../src/parsers/flow/components/events.js | 6 ++++++ .../src/parsers/flow/components/index.js | 6 ++++++ .../src/parsers/typescript/components/events.js | 8 ++++++++ .../src/parsers/typescript/components/index.js | 6 ++++++ packages/rn-tester/js/components/RNTesterModuleList.js | 4 ++++ packages/rn-tester/js/components/RNTesterNavbar.js | 2 ++ .../js/examples/AnimatedGratuitousApp/AnExApp.js | 2 ++ packages/rn-tester/js/examples/FlatList/FlatList-basic.js | 4 ++++ .../js/examples/FlatList/FlatList-multiColumn.js | 2 ++ packages/rn-tester/js/examples/Modal/ModalPresentation.js | 2 ++ packages/rn-tester/js/examples/RTL/RTLExample.js | 2 ++ .../js/examples/SectionList/SectionList-scrollable.js | 8 ++++++++ .../js/examples/SectionList/SectionListBaseExample.js | 2 ++ packages/rn-tester/js/examples/Text/TextExample.ios.js | 2 ++ .../js/examples/TextInput/TextInputExample.android.js | 6 ++++++ .../js/examples/TextInput/TextInputSharedExamples.js | 4 ++++ 37 files changed, 118 insertions(+), 2 deletions(-) diff --git a/Libraries/Alert/Alert.js b/Libraries/Alert/Alert.js index f248e2b9055bbe..1a943e1bbd7b0f 100644 --- a/Libraries/Alert/Alert.js +++ b/Libraries/Alert/Alert.js @@ -92,6 +92,8 @@ class Alert { config.buttonPositive = buttonPositive.text || defaultPositiveText; } + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by + * Flow's LTI update could not be added via codemod */ const onAction = (action, buttonKey) => { if (action === constants.buttonClicked) { if (buttonKey === constants.buttonNeutral) { diff --git a/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js b/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js index 8ae7f993da40df..dd035b56a8aaa2 100644 --- a/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +++ b/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js @@ -232,6 +232,8 @@ class DrawerLayoutAndroid extends React.Component { ); } + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ _onDrawerSlide = event => { if (this.props.onDrawerSlide) { this.props.onDrawerSlide(event); @@ -253,6 +255,8 @@ class DrawerLayoutAndroid extends React.Component { } }; + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ _onDrawerStateChanged = event => { if (this.props.onDrawerStateChanged) { this.props.onDrawerStateChanged( diff --git a/Libraries/Components/Pressable/Pressable.js b/Libraries/Components/Pressable/Pressable.js index 6db069675b8cf0..aab4f21d33ed89 100644 --- a/Libraries/Components/Pressable/Pressable.js +++ b/Libraries/Components/Pressable/Pressable.js @@ -170,6 +170,8 @@ type Props = $ReadOnly<{| * Component used to build display components that should respond to whether the * component is currently pressed or not. */ +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ function Pressable(props: Props, forwardedRef): React.Node { const { accessible, diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index 09ef62817f4878..b268c65c2b5f5c 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -1822,6 +1822,8 @@ const styles = StyleSheet.create({ }, }); +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ function Wrapper(props, ref: (mixed => mixed) | {current: mixed, ...}) { return ; } diff --git a/Libraries/Components/ScrollView/ScrollViewStickyHeader.js b/Libraries/Components/ScrollView/ScrollViewStickyHeader.js index ebd6f676def560..f6ca3ac8e1e6f4 100644 --- a/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +++ b/Libraries/Components/ScrollView/ScrollViewStickyHeader.js @@ -177,6 +177,8 @@ class ScrollViewStickyHeader extends React.Component { } }; + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ _setComponentRef = ref => { this._ref = ref; }; diff --git a/Libraries/Components/Touchable/PooledClass.js b/Libraries/Components/Touchable/PooledClass.js index 7a57583a69cb2d..3b0c41c9f95be6 100644 --- a/Libraries/Components/Touchable/PooledClass.js +++ b/Libraries/Components/Touchable/PooledClass.js @@ -62,6 +62,8 @@ const fourArgumentPooler = function (a1: any, a2: any, a3: any, a4: any) { } }; +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ const standardReleaser = function (instance) { const Klass = this; // eslint-disable-line consistent-this invariant( diff --git a/Libraries/Components/Touchable/TouchableNativeFeedback.js b/Libraries/Components/Touchable/TouchableNativeFeedback.js index 2064a81c36c632..8fff2f302397f2 100644 --- a/Libraries/Components/Touchable/TouchableNativeFeedback.js +++ b/Libraries/Components/Touchable/TouchableNativeFeedback.js @@ -312,11 +312,15 @@ class TouchableNativeFeedback extends React.Component { const getBackgroundProp = Platform.OS === 'android' - ? (background, useForeground: boolean) => + ? /* $FlowFixMe[missing-local-annot] The type annotation(s) required by + * Flow's LTI update could not be added via codemod */ + (background, useForeground: boolean) => useForeground && TouchableNativeFeedback.canUseNativeForeground() ? {nativeForegroundAndroid: background} : {nativeBackgroundAndroid: background} - : (background, useForeground: boolean) => null; + : /* $FlowFixMe[missing-local-annot] The type annotation(s) required by + * Flow's LTI update could not be added via codemod */ + (background, useForeground: boolean) => null; TouchableNativeFeedback.displayName = 'TouchableNativeFeedback'; diff --git a/Libraries/Core/ExceptionsManager.js b/Libraries/Core/ExceptionsManager.js index 55c2e4cd12bdce..9d9e46098cbb54 100644 --- a/Libraries/Core/ExceptionsManager.js +++ b/Libraries/Core/ExceptionsManager.js @@ -144,6 +144,8 @@ function handleException(e: mixed, isFatal: boolean) { } } +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ function reactConsoleErrorHandler(...args) { // bubble up to any original handlers console._errorOriginal(...args); diff --git a/Libraries/Core/setUpBatchedBridge.js b/Libraries/Core/setUpBatchedBridge.js index 93ad5278ca281f..17ba06eb818b92 100644 --- a/Libraries/Core/setUpBatchedBridge.js +++ b/Libraries/Core/setUpBatchedBridge.js @@ -27,6 +27,8 @@ if (global.RN$Bridgeless === true && global.RN$registerCallableModule) { | $TEMPORARY$string<'RCTNativeAppEventEmitter'> | $TEMPORARY$string<'SamplingProfiler'> | $TEMPORARY$string<'Systrace'>, + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by + * Flow's LTI update could not be added via codemod */ factory, ) => BatchedBridge.registerLazyCallableModule(moduleName, factory); } diff --git a/Libraries/Image/Image.android.js b/Libraries/Image/Image.android.js index 64c5fd30c81555..eac8a56c63eba7 100644 --- a/Libraries/Image/Image.android.js +++ b/Libraries/Image/Image.android.js @@ -123,6 +123,8 @@ export type ImageComponentStatics = $ReadOnly<{| * * See https://reactnative.dev/docs/image */ +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ const BaseImage = (props: ImagePropsType, forwardedRef) => { let source = resolveAssetSource(props.source); const defaultSource = resolveAssetSource(props.defaultSource); diff --git a/Libraries/Image/Image.ios.js b/Libraries/Image/Image.ios.js index b350a0f9414bc6..7b5d0c0c43372c 100644 --- a/Libraries/Image/Image.ios.js +++ b/Libraries/Image/Image.ios.js @@ -102,6 +102,8 @@ export type ImageComponentStatics = $ReadOnly<{| * * See https://reactnative.dev/docs/image */ +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ const BaseImage = (props: ImagePropsType, forwardedRef) => { const source = resolveAssetSource(props.source) || { uri: undefined, diff --git a/Libraries/Lists/SectionList.js b/Libraries/Lists/SectionList.js index e99675ad145606..2b1299cadf2dde 100644 --- a/Libraries/Lists/SectionList.js +++ b/Libraries/Lists/SectionList.js @@ -255,6 +255,8 @@ export default class SectionList< } _wrapperListRef: ?React.ElementRef; + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ _captureRef = ref => { this._wrapperListRef = ref; }; diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 1897a5d3dcb26e..69e63090ea32d5 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -1241,6 +1241,8 @@ class VirtualizedList extends React.PureComponent { _updateCellsToRenderBatcher: Batchinator; _viewabilityTuples: Array = []; + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ _captureScrollRef = ref => { this._scrollRef = ref; }; @@ -1253,6 +1255,8 @@ class VirtualizedList extends React.PureComponent { ); } + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ _defaultRenderScrollComponent = props => { const onRefresh = props.onRefresh; if (this._isNestedWithSameOrientation()) { diff --git a/Libraries/LogBox/LogBox.js b/Libraries/LogBox/LogBox.js index e2af653bf319bf..12c1f9552478b1 100644 --- a/Libraries/LogBox/LogBox.js +++ b/Libraries/LogBox/LogBox.js @@ -166,6 +166,8 @@ if (__DEV__) { } }; + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ const registerError = (...args): void => { // Let errors within LogBox itself fall through. if (LogBoxData.isLogBoxErrorMessage(args[0])) { diff --git a/Libraries/LogBox/UI/AnsiHighlight.js b/Libraries/LogBox/UI/AnsiHighlight.js index aab1a5e39d64f0..4095298dbbd2fd 100644 --- a/Libraries/LogBox/UI/AnsiHighlight.js +++ b/Libraries/LogBox/UI/AnsiHighlight.js @@ -63,6 +63,8 @@ export default function Ansi({ } }); + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ const getText = (content, key) => { if (key === 1) { // Remove the vertical bar after line numbers diff --git a/Libraries/NativeComponent/__tests__/StaticViewConfigValidator-test.js b/Libraries/NativeComponent/__tests__/StaticViewConfigValidator-test.js index 28b471938c7709..f7d1a4b9cee0d8 100644 --- a/Libraries/NativeComponent/__tests__/StaticViewConfigValidator-test.js +++ b/Libraries/NativeComponent/__tests__/StaticViewConfigValidator-test.js @@ -211,7 +211,11 @@ StaticViewConfigValidator: Invalid static view config for 'RCTView'. function expectSVCToNotMatchNVC( name: string, + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ nativeViewConfig, + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ staticViewConfig, message: string, ) { diff --git a/Libraries/Pressability/__tests__/Pressability-test.js b/Libraries/Pressability/__tests__/Pressability-test.js index 42af85f3dff36b..f73c5b129ac037 100644 --- a/Libraries/Pressability/__tests__/Pressability-test.js +++ b/Libraries/Pressability/__tests__/Pressability-test.js @@ -28,6 +28,8 @@ function getMock, TReturn>( return (fn: $FlowFixMe); } +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ const createMockPressability = overrides => { const config = { cancelable: null, diff --git a/Libraries/Storage/AsyncStorage.js b/Libraries/Storage/AsyncStorage.js index f0bb47f8157367..6b433b0387bf1a 100644 --- a/Libraries/Storage/AsyncStorage.js +++ b/Libraries/Storage/AsyncStorage.js @@ -366,6 +366,8 @@ function convertErrors( declare function convertError(void | null): null; declare function convertError({message: string, key?: string}): Error; +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ function convertError(error) { if (!error) { return null; diff --git a/Libraries/Utilities/__tests__/useMergeRefs-test.js b/Libraries/Utilities/__tests__/useMergeRefs-test.js index 558500f294a0cb..06d0658cf6c3d8 100644 --- a/Libraries/Utilities/__tests__/useMergeRefs-test.js +++ b/Libraries/Utilities/__tests__/useMergeRefs-test.js @@ -17,6 +17,8 @@ import {act, create} from 'react-test-renderer'; /** * TestView provide a component execution environment to test hooks. */ +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ function TestView({name, refs}) { const mergeRef = useMergeRefs(...refs); return ; diff --git a/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js b/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js index e251d5de8577ad..51eac5cbaf299d 100644 --- a/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +++ b/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js @@ -70,6 +70,8 @@ function deepFreezeAndThrowOnMutationInDev>( return object; } +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ function throwOnImmutableMutation(key: empty, value) { throw Error( 'You attempted to set the key `' + diff --git a/ReactAndroid/src/androidTest/js/UIManagerTestModule.js b/ReactAndroid/src/androidTest/js/UIManagerTestModule.js index 862d96d2bff84d..e51d10721ed83a 100644 --- a/ReactAndroid/src/androidTest/js/UIManagerTestModule.js +++ b/ReactAndroid/src/androidTest/js/UIManagerTestModule.js @@ -188,6 +188,8 @@ class UpdatePositionInListTestApp extends React.Component< active: false, }; + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ constructor(...args) { super(...args); flushUpdatePositionInList = () => this.setState({active: true}); diff --git a/packages/react-native-codegen/src/parsers/flow/components/events.js b/packages/react-native-codegen/src/parsers/flow/components/events.js index b6a3db01f522c6..a6a788a467d86e 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/events.js +++ b/packages/react-native-codegen/src/parsers/flow/components/events.js @@ -17,6 +17,8 @@ import type { } from '../../../CodegenSchema.js'; function getPropertyType( + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ name, optional: boolean, typeAnnotation: $FlowFixMe, @@ -151,6 +153,8 @@ function findEventArgumentsAndType( } } +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ function buildPropertiesForEvent(property): NamedShape { const name = property.key.name; const optional = @@ -163,6 +167,8 @@ function buildPropertiesForEvent(property): NamedShape { return getPropertyType(name, optional, typeAnnotation); } +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ function getEventArgument(argumentProps, name: $FlowFixMe) { return { type: 'ObjectTypeAnnotation', diff --git a/packages/react-native-codegen/src/parsers/flow/components/index.js b/packages/react-native-codegen/src/parsers/flow/components/index.js index 39345342c67092..e488635d94300e 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/index.js +++ b/packages/react-native-codegen/src/parsers/flow/components/index.js @@ -20,6 +20,8 @@ const {getExtendsProps, removeKnownExtends} = require('./extends'); const {getCommandOptions, getOptions} = require('./options'); const {getPropProperties, getProps} = require('./props'); +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ function findComponentConfig(ast) { const foundConfigs = []; @@ -123,6 +125,8 @@ function findComponentConfig(ast) { } function getCommandProperties( + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ commandTypeName, types: TypeDeclarationMap, commandOptions: ?CommandOptions, @@ -175,6 +179,8 @@ function getCommandProperties( } // $FlowFixMe[signature-verification-failure] there's no flowtype for AST +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ function buildComponentSchema(ast): ComponentSchemaBuilderConfig { const { componentName, diff --git a/packages/react-native-codegen/src/parsers/typescript/components/events.js b/packages/react-native-codegen/src/parsers/typescript/components/events.js index cd94fa00596535..6f05b5059e9723 100644 --- a/packages/react-native-codegen/src/parsers/typescript/components/events.js +++ b/packages/react-native-codegen/src/parsers/typescript/components/events.js @@ -17,8 +17,12 @@ import type { } from '../../../CodegenSchema.js'; function getPropertyType( + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ name, optional: boolean, + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ typeAnnotation, ): NamedShape { const type = @@ -169,6 +173,8 @@ function findEventArgumentsAndType( } } +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ function buildPropertiesForEvent(property): NamedShape { const name = property.key.name; const optional = property.optional || false; @@ -177,6 +183,8 @@ function buildPropertiesForEvent(property): NamedShape { return getPropertyType(name, optional, typeAnnotation); } +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ function getEventArgument(argumentProps, name: $FlowFixMe) { return { type: 'ObjectTypeAnnotation', diff --git a/packages/react-native-codegen/src/parsers/typescript/components/index.js b/packages/react-native-codegen/src/parsers/typescript/components/index.js index 14200463b51e90..77258ed4b9c2db 100644 --- a/packages/react-native-codegen/src/parsers/typescript/components/index.js +++ b/packages/react-native-codegen/src/parsers/typescript/components/index.js @@ -20,6 +20,8 @@ const {getExtendsProps, removeKnownExtends} = require('./extends'); const {getCommandOptions, getOptions} = require('./options'); const {getPropProperties, getProps} = require('./props'); +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ function findComponentConfig(ast) { const foundConfigs = []; @@ -123,6 +125,8 @@ function findComponentConfig(ast) { } function getCommandProperties( + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ commandTypeName, types: TypeDeclarationMap, commandOptions: ?CommandOptions, @@ -176,6 +180,8 @@ function getCommandProperties( } // $FlowFixMe[signature-verification-failure] TODO(T108222691): Use flow-types for @babel/parser +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ function buildComponentSchema(ast): ComponentSchemaBuilderConfig { const { componentName, diff --git a/packages/rn-tester/js/components/RNTesterModuleList.js b/packages/rn-tester/js/components/RNTesterModuleList.js index 0ccbe6216fd017..8dbcb28b3b9777 100644 --- a/packages/rn-tester/js/components/RNTesterModuleList.js +++ b/packages/rn-tester/js/components/RNTesterModuleList.js @@ -24,6 +24,8 @@ const { import {RNTesterThemeContext} from './RNTesterTheme'; +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ const ExampleModuleRow = ({ onShowUnderlay, onHideUnderlay, @@ -123,6 +125,8 @@ const RNTesterModuleList: React$AbstractComponent = React.memo( (!category || example.category === category) && (!Platform.isTV || example.supportsTVOS); + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by + * Flow's LTI update could not be added via codemod */ const renderListItem = ({item, section, separators}) => { return ( ); +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ const NavbarButton = ({ testID, theme, diff --git a/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExApp.js b/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExApp.js index 3788016c810b1a..8d2bc6ae1d89f9 100644 --- a/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExApp.js +++ b/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExApp.js @@ -235,6 +235,8 @@ class AnExApp extends React.Component { } else { let onLayout = null; if (!this.state.restLayouts[idx]) { + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by + * Flow's LTI update could not be added via codemod */ onLayout = function (index, e) { const layout = e.nativeEvent.layout; this.setState(state => { diff --git a/packages/rn-tester/js/examples/FlatList/FlatList-basic.js b/packages/rn-tester/js/examples/FlatList/FlatList-basic.js index e222efbd0d7507..9d3796062a7dff 100644 --- a/packages/rn-tester/js/examples/FlatList/FlatList-basic.js +++ b/packages/rn-tester/js/examples/FlatList/FlatList-basic.js @@ -87,6 +87,8 @@ class FlatListExample extends React.PureComponent { isRTL: IS_RTL, }; + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ _onChangeFilterText = filterText => { this.setState({filterText}); }; @@ -297,6 +299,8 @@ class FlatListExample extends React.PureComponent { /* $FlowFixMe[invalid-computed-prop] (>=0.111.0 site=react_native_fb) * This comment suppresses an error found when Flow v0.111 was deployed. * To see the error, delete this comment and run Flow. */ + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by + * Flow's LTI update could not be added via codemod */ [flatListPropKey]: ({item, separators}) => { return ( { this.setState(() => ({filterText})); }; diff --git a/packages/rn-tester/js/examples/Modal/ModalPresentation.js b/packages/rn-tester/js/examples/Modal/ModalPresentation.js index 86e02562daa56b..b2b2aab6bb67e3 100644 --- a/packages/rn-tester/js/examples/Modal/ModalPresentation.js +++ b/packages/rn-tester/js/examples/Modal/ModalPresentation.js @@ -60,6 +60,8 @@ function ModalPresentation() { alert('onShow'); } }; + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ const onOrientationChange = event => setCurrentOrientation(event.nativeEvent.orientation); const modalBackgroundStyle = { diff --git a/packages/rn-tester/js/examples/RTL/RTLExample.js b/packages/rn-tester/js/examples/RTL/RTLExample.js index f9bb40b4b3a83f..4d1dfb322da030 100644 --- a/packages/rn-tester/js/examples/RTL/RTLExample.js +++ b/packages/rn-tester/js/examples/RTL/RTLExample.js @@ -158,6 +158,8 @@ function withRTLState( {style?: any}, RTLSwitcherComponentState, > { + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by + * Flow's LTI update could not be added via codemod */ constructor(...args) { super(...args); this.state = { diff --git a/packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js b/packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js index 58452b7badc0a9..aa8ea52ec9899e 100644 --- a/packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js +++ b/packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js @@ -78,6 +78,8 @@ const CONSTANT_SECTION_EXAMPLES = [ }, ]; +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ const renderSectionHeader = ({section}) => ( SECTION HEADER: {section.key} @@ -85,6 +87,8 @@ const renderSectionHeader = ({section}) => ( ); +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ const renderSectionFooter = ({section}) => ( SECTION FOOTER: {section.key} @@ -92,6 +96,8 @@ const renderSectionFooter = ({section}) => ( ); +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ const CustomSeparatorComponent = ({highlighted, text}) => ( ( const renderItemComponent = (setItemState: (item: Item) => void) => + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ ({item, separators}) => { if (isNaN(item.key)) { return; diff --git a/packages/rn-tester/js/examples/SectionList/SectionListBaseExample.js b/packages/rn-tester/js/examples/SectionList/SectionListBaseExample.js index b234b2e106af4a..2bf5c915f95156 100644 --- a/packages/rn-tester/js/examples/SectionList/SectionListBaseExample.js +++ b/packages/rn-tester/js/examples/SectionList/SectionListBaseExample.js @@ -38,6 +38,8 @@ const DATA = [ }, ]; +/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ const Item = ({item, section, separators}) => { return ( diff --git a/packages/rn-tester/js/examples/TextInput/TextInputExample.android.js b/packages/rn-tester/js/examples/TextInput/TextInputExample.android.js index 8238cd876a9f6f..48f1e531e15924 100644 --- a/packages/rn-tester/js/examples/TextInput/TextInputExample.android.js +++ b/packages/rn-tester/js/examples/TextInput/TextInputExample.android.js @@ -29,6 +29,8 @@ class ToggleDefaultPaddingExample extends React.Component< $FlowFixMeProps, $FlowFixMeState, > { + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ constructor(props) { super(props); this.state = {hasPadding: false}; @@ -47,6 +49,8 @@ class ToggleDefaultPaddingExample extends React.Component< } class AutogrowingTextInputExample extends React.Component<{...}> { + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ constructor(props) { super(props); @@ -63,6 +67,8 @@ class AutogrowingTextInputExample extends React.Component<{...}> { }; } + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ UNSAFE_componentWillReceiveProps(props) { /* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found * when making Flow check .android.js files. */ diff --git a/packages/rn-tester/js/examples/TextInput/TextInputSharedExamples.js b/packages/rn-tester/js/examples/TextInput/TextInputSharedExamples.js index 24874bf2dac977..44304d8d776577 100644 --- a/packages/rn-tester/js/examples/TextInput/TextInputSharedExamples.js +++ b/packages/rn-tester/js/examples/TextInput/TextInputSharedExamples.js @@ -379,6 +379,8 @@ class SelectionExample extends React.Component< > { _textInput: React.ElementRef | null = null; + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ constructor(props) { super(props); this.state = { @@ -387,6 +389,8 @@ class SelectionExample extends React.Component< }; } + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ onSelectionChange({nativeEvent: {selection}}) { this.setState({selection}); }