From 972b546fc69d17215e13f4d268d8ec8bb762c96b Mon Sep 17 00:00:00 2001 From: Gabe Levi Date: Mon, 22 Jun 2015 09:43:30 -0700 Subject: [PATCH] [Flow] Fix or suppress errors in react-native for Flow v0.13.0 --- .flowconfig | 5 +++-- Examples/Movies/SearchScreen.js | 2 ++ Examples/UIExplorer/DatePickerIOSExample.js | 1 + Examples/UIExplorer/ImageExample.js | 1 + Examples/UIExplorer/MapViewExample.js | 1 + Examples/UIExplorer/PickerIOSExample.js | 1 + Examples/UIExplorer/ProgressViewIOSExample.js | 1 + Examples/UIExplorer/ScrollViewExample.js | 1 + Examples/UIExplorer/TextInputExample.js | 1 + Examples/UIExplorer/TouchableExample.js | 1 + Examples/UIExplorer/WebViewExample.js | 1 + Libraries/AppRegistry/AppRegistry.js | 2 +- 12 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.flowconfig b/.flowconfig index bf06f66d3f8545..56d38f30838ddc 100644 --- a/.flowconfig +++ b/.flowconfig @@ -40,8 +40,9 @@ suppress_type=$FlowIssue suppress_type=$FlowFixMe suppress_type=$FixMe -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue #[0-9]+ +suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(1[0-2]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(1[0-2]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)? #[0-9]+ +suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy [version] 0.12.0 diff --git a/Examples/Movies/SearchScreen.js b/Examples/Movies/SearchScreen.js index e7eb7f2b4a299d..21819df4665f97 100644 --- a/Examples/Movies/SearchScreen.js +++ b/Examples/Movies/SearchScreen.js @@ -77,12 +77,14 @@ var SearchScreen = React.createClass({ var apiKey = API_KEYS[this.state.queryNumber % API_KEYS.length]; if (query) { return ( + // $FlowFixMe(>=0.13.0) - pageNumber may be null or undefined API_URL + 'movies.json?apikey=' + apiKey + '&q=' + encodeURIComponent(query) + '&page_limit=20&page=' + pageNumber ); } else { // With no query, load latest movies return ( + // $FlowFixMe(>=0.13.0) - pageNumber may be null or undefined API_URL + 'lists/movies/in_theaters.json?apikey=' + apiKey + '&page_limit=20&page=' + pageNumber ); diff --git a/Examples/UIExplorer/DatePickerIOSExample.js b/Examples/UIExplorer/DatePickerIOSExample.js index 36ff9cd52bbbb2..fc7686880adff5 100644 --- a/Examples/UIExplorer/DatePickerIOSExample.js +++ b/Examples/UIExplorer/DatePickerIOSExample.js @@ -125,6 +125,7 @@ var Heading = React.createClass({ } }); +exports.displayName = (undefined: ?string); exports.title = ''; exports.description = 'Select dates and times using the native UIDatePicker.'; exports.examples = [ diff --git a/Examples/UIExplorer/ImageExample.js b/Examples/UIExplorer/ImageExample.js index b4c54f997d158f..60a4a5ab1ab24a 100644 --- a/Examples/UIExplorer/ImageExample.js +++ b/Examples/UIExplorer/ImageExample.js @@ -25,6 +25,7 @@ var { var ImageCapInsetsExample = require('./ImageCapInsetsExample'); +exports.displayName = (undefined: ?string); exports.framework = 'React'; exports.title = ''; exports.description = 'Base component for displaying different types of images.'; diff --git a/Examples/UIExplorer/MapViewExample.js b/Examples/UIExplorer/MapViewExample.js index 23789c7f1346b8..0d1061acef49b8 100644 --- a/Examples/UIExplorer/MapViewExample.js +++ b/Examples/UIExplorer/MapViewExample.js @@ -236,6 +236,7 @@ var styles = StyleSheet.create({ }, }); +exports.displayName = (undefined: ?string); exports.title = ''; exports.description = 'Base component to display maps'; exports.examples = [ diff --git a/Examples/UIExplorer/PickerIOSExample.js b/Examples/UIExplorer/PickerIOSExample.js index 14361e7608165d..31c81ccccdad5c 100644 --- a/Examples/UIExplorer/PickerIOSExample.js +++ b/Examples/UIExplorer/PickerIOSExample.js @@ -112,6 +112,7 @@ var PickerExample = React.createClass({ }, }); +exports.displayName = (undefined: ?string); exports.title = ''; exports.description = 'Render lists of selectable options with UIPickerView.'; exports.examples = [ diff --git a/Examples/UIExplorer/ProgressViewIOSExample.js b/Examples/UIExplorer/ProgressViewIOSExample.js index f0a17a7c6e78f2..e294a33708122a 100644 --- a/Examples/UIExplorer/ProgressViewIOSExample.js +++ b/Examples/UIExplorer/ProgressViewIOSExample.js @@ -60,6 +60,7 @@ var ProgressViewExample = React.createClass({ }, }); +exports.displayName = (undefined: ?string); exports.framework = 'React'; exports.title = 'ProgressViewIOS'; exports.description = 'ProgressViewIOS'; diff --git a/Examples/UIExplorer/ScrollViewExample.js b/Examples/UIExplorer/ScrollViewExample.js index 69f3ac9c72d254..1ca8baf9a8530c 100644 --- a/Examples/UIExplorer/ScrollViewExample.js +++ b/Examples/UIExplorer/ScrollViewExample.js @@ -23,6 +23,7 @@ var { Image } = React; +exports.displayName = (undefined: ?string); exports.title = ''; exports.description = 'Component that enables scrolling through child components'; exports.examples = [ diff --git a/Examples/UIExplorer/TextInputExample.js b/Examples/UIExplorer/TextInputExample.js index 10064491d6e660..06cc12ee383266 100644 --- a/Examples/UIExplorer/TextInputExample.js +++ b/Examples/UIExplorer/TextInputExample.js @@ -133,6 +133,7 @@ var styles = StyleSheet.create({ }, }); +exports.displayName = (undefined: ?string); exports.title = ''; exports.description = 'Single and multi-line text inputs.'; exports.examples = [ diff --git a/Examples/UIExplorer/TouchableExample.js b/Examples/UIExplorer/TouchableExample.js index acbba362921ea0..494d7771d8b383 100644 --- a/Examples/UIExplorer/TouchableExample.js +++ b/Examples/UIExplorer/TouchableExample.js @@ -26,6 +26,7 @@ var { View, } = React; +exports.displayName = (undefined: ?string); exports.title = ' and onPress'; exports.examples = [ { diff --git a/Examples/UIExplorer/WebViewExample.js b/Examples/UIExplorer/WebViewExample.js index 6a93f80e6bc947..fe3cbef6f7d590 100644 --- a/Examples/UIExplorer/WebViewExample.js +++ b/Examples/UIExplorer/WebViewExample.js @@ -220,6 +220,7 @@ var styles = StyleSheet.create({ }, }); +exports.displayName = (undefined: ?string); exports.title = ''; exports.description = 'Base component to display web content'; exports.examples = [ diff --git a/Libraries/AppRegistry/AppRegistry.js b/Libraries/AppRegistry/AppRegistry.js index 157cbaa379b134..7465d85b925d32 100644 --- a/Libraries/AppRegistry/AppRegistry.js +++ b/Libraries/AppRegistry/AppRegistry.js @@ -68,7 +68,7 @@ var AppRegistry = { console.log( 'Running application "' + appKey + '" with appParams: ' + JSON.stringify(appParameters) + '. ' + - '__DEV__ === ' + __DEV__ + + '__DEV__ === ' + String(__DEV__) + ', development-level warning are ' + (__DEV__ ? 'ON' : 'OFF') + ', performance optimizations are ' + (__DEV__ ? 'OFF' : 'ON') );