From f4072b1e005f4067bb3bd358e890c3ae8b197de2 Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Tue, 17 Jan 2023 22:24:49 -0800 Subject: [PATCH] Pre-suppress errors ahead of 0.197.0 release Summary: Changelog: [internal] Reviewed By: mroch Differential Revision: D42558696 fbshipit-source-id: 3367fb1233c9630bd31b0ae9950f7b2f13438057 --- Libraries/Components/StatusBar/StatusBar.js | 3 +++ .../src/parsers/__tests__/parsers-primitives-test.js | 1 + packages/rn-tester/js/components/TextLegend.js | 1 + packages/rn-tester/js/examples/FlatList/FlatList-basic.js | 1 + .../rn-tester/js/examples/Touchable/TouchableExample.js | 1 + packages/rn-tester/js/utils/RNTesterNavigationReducer.js | 6 ++++-- 6 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Libraries/Components/StatusBar/StatusBar.js b/Libraries/Components/StatusBar/StatusBar.js index 9110827229c..2ac3d1f6b09 100644 --- a/Libraries/Components/StatusBar/StatusBar.js +++ b/Libraries/Components/StatusBar/StatusBar.js @@ -238,9 +238,11 @@ class StatusBar extends React.Component { }); // Timer for updating the native module values at the end of the frame. + // $FlowFixMe[missing-local-annot] static _updateImmediate = null; // The current merged values from the props stack. + // $FlowFixMe[missing-local-annot] static _currentValues = null; // TODO(janic): Provide a real API to deal with status bar height. See the @@ -387,6 +389,7 @@ class StatusBar extends React.Component { return newEntry; } + // $FlowFixMe[missing-local-annot] _stackEntry = null; componentDidMount() { diff --git a/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js b/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js index 08dc3e5191e..b4017e8dd14 100644 --- a/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js +++ b/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js @@ -362,6 +362,7 @@ describe('emitPromise', () => { /* aliasMap: {...NativeModuleAliasMap} */ {}, /* tryParse: ParserErrorCapturer */ + // $FlowFixMe[missing-local-annot] function (_: () => T) { return null; }, diff --git a/packages/rn-tester/js/components/TextLegend.js b/packages/rn-tester/js/components/TextLegend.js index 75644c3fca2..52b09a240b8 100644 --- a/packages/rn-tester/js/components/TextLegend.js +++ b/packages/rn-tester/js/components/TextLegend.js @@ -40,6 +40,7 @@ const PANGRAMS = { export default function TextLegend(): React.Node { const [language, setLanguage] = React.useState('english'); const [alignment, setAlignment] = React.useState('left'); + // $FlowFixMe[missing-empty-array-annot] const [textMetrics, setTextMetrics] = React.useState([]); const [fontSize, setFontSize] = React.useState(50); return ( diff --git a/packages/rn-tester/js/examples/FlatList/FlatList-basic.js b/packages/rn-tester/js/examples/FlatList/FlatList-basic.js index 64f2800a355..25c511e570a 100644 --- a/packages/rn-tester/js/examples/FlatList/FlatList-basic.js +++ b/packages/rn-tester/js/examples/FlatList/FlatList-basic.js @@ -233,6 +233,7 @@ class FlatListExample extends React.PureComponent { ListHeaderComponent={} ListFooterComponent={FooterComponent} ListEmptyComponent={ListEmptyComponent} + // $FlowFixMe[missing-empty-array-annot] data={this.state.empty ? [] : filteredData} debug={this.state.debug} disableVirtualization={!this.state.virtualized} diff --git a/packages/rn-tester/js/examples/Touchable/TouchableExample.js b/packages/rn-tester/js/examples/Touchable/TouchableExample.js index ae426ae190e..8242039d797 100644 --- a/packages/rn-tester/js/examples/Touchable/TouchableExample.js +++ b/packages/rn-tester/js/examples/Touchable/TouchableExample.js @@ -540,6 +540,7 @@ const TouchableTouchSoundDisabled = () => { ); }; +// $FlowFixMe[missing-local-annot] function TouchableOnFocus>() { const ref = useRef | {focus: Function}>(null); const [isFocused, setIsFocused] = useState(false); diff --git a/packages/rn-tester/js/utils/RNTesterNavigationReducer.js b/packages/rn-tester/js/utils/RNTesterNavigationReducer.js index 797f5a02e80..95f6a969424 100644 --- a/packages/rn-tester/js/utils/RNTesterNavigationReducer.js +++ b/packages/rn-tester/js/utils/RNTesterNavigationReducer.js @@ -32,7 +32,8 @@ const getUpdatedBookmarks = ({ }) => { const updatedBookmarks = bookmarks ? {...bookmarks} - : {components: [], apis: []}; + : // $FlowFixMe[missing-empty-array-annot] + {components: [], apis: []}; if (!exampleType || !key) { return null; @@ -60,7 +61,8 @@ const getUpdatedRecentlyUsed = ({ }) => { const updatedRecentlyUsed = recentlyUsed ? {...recentlyUsed} - : {components: [], apis: []}; + : // $FlowFixMe[missing-empty-array-annot] + {components: [], apis: []}; if (!exampleType || !key) { return updatedRecentlyUsed;