From e8198aed8d094087d5da898a325916dd44b86d5a Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Fri, 14 Oct 2016 08:53:57 -0700 Subject: [PATCH] Cleanup: Prefer `React.Element` over `React$?Element` Reviewed By: vjeux Differential Revision: D4013049 fbshipit-source-id: 18a447fdbc584418d6a51770363bcd221e7fb7dc --- .../UIExplorer/js/AccessibilityIOSExample.js | 2 +- .../UIExplorer/js/ActionSheetIOSExample.js | 10 ++++----- Examples/UIExplorer/js/AdSupportIOSExample.js | 2 +- Examples/UIExplorer/js/AlertIOSExample.js | 2 +- .../js/AnimatedGratuitousApp/AnExApp.js | 4 ++-- .../js/AnimatedGratuitousApp/AnExBobble.js | 2 +- .../js/AnimatedGratuitousApp/AnExSet.js | 2 +- .../js/AnimatedGratuitousApp/AnExTilt.js | 2 +- Examples/UIExplorer/js/AppStateExample.js | 6 ++--- Examples/UIExplorer/js/AsyncStorageExample.js | 2 +- Examples/UIExplorer/js/CameraRollExample.js | 2 +- .../UIExplorer/js/DatePickerIOSExample.js | 2 +- Examples/UIExplorer/js/ExampleTypes.js | 2 +- Examples/UIExplorer/js/GeolocationExample.js | 2 +- .../UIExplorer/js/LayoutAnimationExample.js | 4 ++-- Examples/UIExplorer/js/LayoutEventsExample.js | 2 +- .../UIExplorer/js/ListViewPagingExample.js | 2 +- ...CardStack-NavigationHeader-Tabs-example.js | 22 +++++++++---------- .../NavigationCardStack-NoGesture-example.js | 6 ++--- .../NavigationCardStack-example.js | 6 ++--- ...gationTransitioner-AnimatedView-example.js | 10 ++++----- ...Transitioner-AnimatedView-pager-example.js | 10 ++++----- Examples/UIExplorer/js/NetInfoExample.js | 8 +++---- Examples/UIExplorer/js/PickerIOSExample.js | 4 ++-- .../js/PushNotificationIOSExample.js | 6 ++--- .../UIExplorer/js/RCTRootViewIOSExample.js | 4 ++-- .../js/SegmentedControlIOSExample.js | 12 +++++----- Examples/UIExplorer/js/SliderExample.js | 18 +++++++-------- Examples/UIExplorer/js/SnapshotExample.js | 2 +- Examples/UIExplorer/js/SwitchExample.js | 10 ++++----- Examples/UIExplorer/js/TextExample.ios.js | 4 ++-- .../UIExplorer/js/TextInputExample.android.js | 6 ++--- .../UIExplorer/js/TextInputExample.ios.js | 4 ++-- Examples/UIExplorer/js/TimerExample.js | 2 +- Examples/UIExplorer/js/TouchableExample.js | 12 +++++----- Examples/UIExplorer/js/TransformExample.js | 2 +- .../js/TransparentHitTestExample.js | 2 +- Examples/UIExplorer/js/UIExplorerApp.ios.js | 6 ++--- .../js/UIExplorerExampleContainer.js | 2 +- .../UIExplorer/js/UIExplorerExampleList.js | 12 +++++----- Examples/UIExplorer/js/WebSocketExample.js | 6 ++--- Examples/UIExplorer/js/WebViewExample.js | 10 ++++----- IntegrationTests/PromiseTest.js | 2 +- .../Keyboard/KeyboardAvoidingView.js | 2 +- Libraries/Components/LazyRenderer.js | 2 +- Libraries/Components/StaticRenderer.js | 2 +- Libraries/Components/StatusBar/StatusBar.js | 2 +- .../Components/Touchable/TouchableBounce.js | 2 +- .../Touchable/TouchableWithoutFeedback.js | 2 +- .../NavigationExperimental/NavigationCard.js | 2 +- .../NavigationCardStack.js | 6 ++--- .../NavigationHeader.js | 12 +++++----- .../NavigationHeaderTitle.js | 2 +- .../NavigationPointerEventsContainer.js | 2 +- Libraries/Experimental/Incremental.js | 2 +- Libraries/Experimental/IncrementalExample.js | 2 +- Libraries/Experimental/IncrementalGroup.js | 2 +- .../SwipeableRow/SwipeableListView.js | 6 ++--- .../SwipeableQuickActionButton.js | 2 +- .../SwipeableRow/SwipeableQuickActions.js | 2 +- .../Experimental/SwipeableRow/SwipeableRow.js | 2 +- Libraries/Experimental/WindowedListView.js | 12 +++++----- Libraries/Inspector/NetworkOverlay.js | 12 +++++----- Libraries/Modal/Modal.js | 2 +- .../NavigationTransitioner.js | 2 +- Libraries/Text/Text.js | 2 +- 66 files changed, 161 insertions(+), 161 deletions(-) diff --git a/Examples/UIExplorer/js/AccessibilityIOSExample.js b/Examples/UIExplorer/js/AccessibilityIOSExample.js index 2536b3037ef..59e5039a8b5 100644 --- a/Examples/UIExplorer/js/AccessibilityIOSExample.js +++ b/Examples/UIExplorer/js/AccessibilityIOSExample.js @@ -68,6 +68,6 @@ exports.description = 'Interface to show iOS\' accessibility samples'; exports.examples = [ { title: 'Accessibility elements', - render(): ReactElement { return ; } + render(): React.Element { return ; } }, ]; diff --git a/Examples/UIExplorer/js/ActionSheetIOSExample.js b/Examples/UIExplorer/js/ActionSheetIOSExample.js index aded7ffe34e..a65af457cb8 100644 --- a/Examples/UIExplorer/js/ActionSheetIOSExample.js +++ b/Examples/UIExplorer/js/ActionSheetIOSExample.js @@ -197,27 +197,27 @@ exports.description = 'Interface to show iOS\' action sheets'; exports.examples = [ { title: 'Show Action Sheet', - render(): ReactElement { return ; } + render(): React.Element { return ; } }, { title: 'Show Action Sheet with tinted buttons', - render(): ReactElement { return ; } + render(): React.Element { return ; } }, { title: 'Show Share Action Sheet', - render(): ReactElement { + render(): React.Element { return ; } }, { title: 'Share Local Image', - render(): ReactElement { + render(): React.Element { return ; } }, { title: 'Share Screenshot', - render(): ReactElement { + render(): React.Element { return ; } } diff --git a/Examples/UIExplorer/js/AdSupportIOSExample.js b/Examples/UIExplorer/js/AdSupportIOSExample.js index f07973d9324..49baf7d7a65 100644 --- a/Examples/UIExplorer/js/AdSupportIOSExample.js +++ b/Examples/UIExplorer/js/AdSupportIOSExample.js @@ -38,7 +38,7 @@ exports.description = 'Example of using the ad support API.'; exports.examples = [ { title: 'Ad Support IOS', - render: function(): ReactElement { + render: function(): React.Element { return ; }, } diff --git a/Examples/UIExplorer/js/AlertIOSExample.js b/Examples/UIExplorer/js/AlertIOSExample.js index 445824368ba..0bd9ffa75f8 100644 --- a/Examples/UIExplorer/js/AlertIOSExample.js +++ b/Examples/UIExplorer/js/AlertIOSExample.js @@ -45,7 +45,7 @@ exports.examples = [{ }, { title: 'Prompt Options', - render(): ReactElement { + render(): React.Element { return ; } }, diff --git a/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExApp.js b/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExApp.js index d8e3addcf31..c7621b42a5a 100644 --- a/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExApp.js +++ b/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExApp.js @@ -89,7 +89,7 @@ class Circle extends React.Component { }); } - render(): ReactElement { + render(): React.Element { if (this.state.panResponder) { var handlers = this.state.panResponder.panHandlers; var dragStyle = { // Used to position while dragging @@ -190,7 +190,7 @@ class AnExApp extends React.Component { this._onMove = this._onMove.bind(this); } - render(): ReactElement { + render(): React.Element { var circles = this.state.keys.map((key, idx) => { if (key === this.state.activeKey) { return ; diff --git a/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExBobble.js b/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExBobble.js index 94d2ce1a3ef..38452adeca5 100644 --- a/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExBobble.js +++ b/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExBobble.js @@ -96,7 +96,7 @@ class AnExBobble extends React.Component { }); } - render(): ReactElement { + render(): React.Element { return ( {this.state.bobbles.map((_, i) => { diff --git a/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExSet.js b/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExSet.js index 464cf887a6e..8e6e9a77d83 100644 --- a/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExSet.js +++ b/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExSet.js @@ -52,7 +52,7 @@ class AnExSet extends React.Component { openColor: randColor(), }; } - render(): ReactElement { + render(): React.Element { var backgroundColor = this.props.openVal ? this.props.openVal.interpolate({ inputRange: [0, 1], diff --git a/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExTilt.js b/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExTilt.js index 5acee72cf1a..35c4e62f250 100644 --- a/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExTilt.js +++ b/Examples/UIExplorer/js/AnimatedGratuitousApp/AnExTilt.js @@ -97,7 +97,7 @@ class AnExTilt extends React.Component { this._startBurnsZoom(); } - render(): ReactElement { + render(): React.Element { return ( { return ; } + render(): React.Element { return ; } }, { title: 'Previous states:', - render(): ReactElement { return ; } + render(): React.Element { return ; } }, { platform: 'ios', title: 'Memory Warnings', description: 'In the IOS simulator, hit Shift+Command+M to simulate a memory warning.', - render(): ReactElement { return ; } + render(): React.Element { return ; } }, ]; diff --git a/Examples/UIExplorer/js/AsyncStorageExample.js b/Examples/UIExplorer/js/AsyncStorageExample.js index 70108c83e53..38ffc4f118f 100644 --- a/Examples/UIExplorer/js/AsyncStorageExample.js +++ b/Examples/UIExplorer/js/AsyncStorageExample.js @@ -120,6 +120,6 @@ exports.description = 'Asynchronous local disk storage.'; exports.examples = [ { title: 'Basics - getItem, setItem, removeItem', - render(): ReactElement { return ; } + render(): React.Element { return ; } }, ]; diff --git a/Examples/UIExplorer/js/CameraRollExample.js b/Examples/UIExplorer/js/CameraRollExample.js index 07d6498dcfb..797986259f2 100644 --- a/Examples/UIExplorer/js/CameraRollExample.js +++ b/Examples/UIExplorer/js/CameraRollExample.js @@ -143,6 +143,6 @@ exports.description = 'Example component that uses CameraRoll to list user\'s ph exports.examples = [ { title: 'Photos', - render(): ReactElement { return ; } + render(): React.Element { return ; } } ]; diff --git a/Examples/UIExplorer/js/DatePickerIOSExample.js b/Examples/UIExplorer/js/DatePickerIOSExample.js index 15f0f83aa4e..6daba2e78d5 100644 --- a/Examples/UIExplorer/js/DatePickerIOSExample.js +++ b/Examples/UIExplorer/js/DatePickerIOSExample.js @@ -135,7 +135,7 @@ exports.description = 'Select dates and times using the native UIDatePicker.'; exports.examples = [ { title: '', - render: function(): ReactElement { + render: function(): React.Element { return ; }, }]; diff --git a/Examples/UIExplorer/js/ExampleTypes.js b/Examples/UIExplorer/js/ExampleTypes.js index 3863bb5bb6e..7d0363016b2 100644 --- a/Examples/UIExplorer/js/ExampleTypes.js +++ b/Examples/UIExplorer/js/ExampleTypes.js @@ -25,7 +25,7 @@ export type Example = { title: string, - render: () => ?ReactElement, + render: () => ?React.Element, description?: string, platform?: string; }; diff --git a/Examples/UIExplorer/js/GeolocationExample.js b/Examples/UIExplorer/js/GeolocationExample.js index 2b611339e57..559172840a7 100644 --- a/Examples/UIExplorer/js/GeolocationExample.js +++ b/Examples/UIExplorer/js/GeolocationExample.js @@ -39,7 +39,7 @@ exports.description = 'Examples of using the Geolocation API.'; exports.examples = [ { title: 'navigator.geolocation', - render: function(): ReactElement { + render: function(): React.Element { return ; }, } diff --git a/Examples/UIExplorer/js/LayoutAnimationExample.js b/Examples/UIExplorer/js/LayoutAnimationExample.js index 8cbc6f9939e..d3836b86e70 100644 --- a/Examples/UIExplorer/js/LayoutAnimationExample.js +++ b/Examples/UIExplorer/js/LayoutAnimationExample.js @@ -161,12 +161,12 @@ exports.title = 'Layout Animation'; exports.description = 'Layout animation'; exports.examples = [{ title: 'Add and remove views', - render(): ReactElement { + render(): React.Element { return ; }, }, { title: 'Cross fade views', - render(): ReactElement { + render(): React.Element { return ; }, }]; diff --git a/Examples/UIExplorer/js/LayoutEventsExample.js b/Examples/UIExplorer/js/LayoutEventsExample.js index 1ca5a97b534..2901f6a984b 100644 --- a/Examples/UIExplorer/js/LayoutEventsExample.js +++ b/Examples/UIExplorer/js/LayoutEventsExample.js @@ -170,7 +170,7 @@ exports.description = 'Examples that show how Layout events can be used to ' + exports.examples = [ { title: 'LayoutEventExample', - render: function(): ReactElement { + render: function(): React.Element { return ; }, }]; diff --git a/Examples/UIExplorer/js/ListViewPagingExample.js b/Examples/UIExplorer/js/ListViewPagingExample.js index 76bd37b6a93..4a50d7b25e0 100644 --- a/Examples/UIExplorer/js/ListViewPagingExample.js +++ b/Examples/UIExplorer/js/ListViewPagingExample.js @@ -142,7 +142,7 @@ class ListViewPagingExample extends React.Component { }; } - renderRow = (rowData: string, sectionID: string, rowID: string): ReactElement => { + renderRow = (rowData: string, sectionID: string, rowID: string): React.Element => { return (); }; diff --git a/Examples/UIExplorer/js/NavigationExperimental/NavigationCardStack-NavigationHeader-Tabs-example.js b/Examples/UIExplorer/js/NavigationExperimental/NavigationCardStack-NavigationHeader-Tabs-example.js index 88f24d17454..6108219295b 100644 --- a/Examples/UIExplorer/js/NavigationExperimental/NavigationCardStack-NavigationHeader-Tabs-example.js +++ b/Examples/UIExplorer/js/NavigationExperimental/NavigationCardStack-NavigationHeader-Tabs-example.js @@ -166,7 +166,7 @@ function createAppNavigationContainer(ComponentClass) { }; } - render(): ReactElement { + render(): React.Element { const navigate = this.context[key] || this.props.navigate; return ; } @@ -191,7 +191,7 @@ class YourApplication extends Component { this._navigate = this._navigate.bind(this); } - render(): ReactElement { + render(): React.Element { // User your own navigator (see next step). return ( {props.scene.route.key} @@ -357,7 +357,7 @@ const YourScene = createAppNavigationContainer(class extends Component { this._pushRoute = this._pushRoute.bind(this); } - render(): ReactElement { + render(): React.Element { return ( {this.props.navigationState.routes.map(this._renderTab, this)} @@ -411,7 +411,7 @@ const YourTabs = createAppNavigationContainer(class extends Component { ); } - _renderTab(route: Object, index: number): ReactElement { + _renderTab(route: Object, index: number): React.Element { return ( { + render(): React.Element { return ( { + render(): React.Element { return ( > { + ): Array> { return transitionProps.scenes.map((scene) => { const sceneProps = { ...transitionProps, @@ -152,7 +152,7 @@ class ExampleNavigator extends Component { _renderScene( sceneProps: NavigationSceneRendererProps, - ): ReactElement { + ): React.Element { return ( { + render(): React.Element { const {scene, navigate} = this.props; return ( { + render(): React.Element { return ( { + render(): React.Element { return ( { + ): React.Element { const scenes = transitionProps.scenes.map((scene) => { const sceneProps = { ...transitionProps, @@ -182,7 +182,7 @@ class ExampleNavigator extends Component { _renderScene( sceneProps: NavigationSceneRendererProps, - ): ReactElement { + ): React.Element { return ( { + render(): React.Element { const {scene, navigate} = this.props; const panHandlers = NavigationPagerPanResponder.forHorizontal({ diff --git a/Examples/UIExplorer/js/NetInfoExample.js b/Examples/UIExplorer/js/NetInfoExample.js index d2563a67fbc..e86929fc4ce 100644 --- a/Examples/UIExplorer/js/NetInfoExample.js +++ b/Examples/UIExplorer/js/NetInfoExample.js @@ -175,22 +175,22 @@ exports.examples = [ { title: 'NetInfo.isConnected', description: 'Asynchronously load and observe connectivity', - render(): ReactElement { return ; } + render(): React.Element { return ; } }, { title: 'NetInfo.update', description: 'Asynchronously load and observe connectionInfo', - render(): ReactElement { return ; } + render(): React.Element { return ; } }, { title: 'NetInfo.updateHistory', description: 'Observed updates to connectionInfo', - render(): ReactElement { return ; } + render(): React.Element { return ; } }, { platform: 'android', title: 'NetInfo.isConnectionExpensive (Android)', description: 'Asynchronously check isConnectionExpensive', - render(): ReactElement { return ; } + render(): React.Element { return ; } }, ]; diff --git a/Examples/UIExplorer/js/PickerIOSExample.js b/Examples/UIExplorer/js/PickerIOSExample.js index b6c8b8ba292..9e1b16670d0 100644 --- a/Examples/UIExplorer/js/PickerIOSExample.js +++ b/Examples/UIExplorer/js/PickerIOSExample.js @@ -147,13 +147,13 @@ exports.description = 'Render lists of selectable options with UIPickerView.'; exports.examples = [ { title: '', - render: function(): ReactElement { + render: function(): React.Element { return ; }, }, { title: ' with custom styling', - render: function(): ReactElement { + render: function(): React.Element { return ; }, }]; diff --git a/Examples/UIExplorer/js/PushNotificationIOSExample.js b/Examples/UIExplorer/js/PushNotificationIOSExample.js index b9bafe2a2ad..eed4c7a7042 100644 --- a/Examples/UIExplorer/js/PushNotificationIOSExample.js +++ b/Examples/UIExplorer/js/PushNotificationIOSExample.js @@ -193,7 +193,7 @@ exports.description = 'Apple PushNotification and badge value'; exports.examples = [ { title: 'Badge Number', - render(): ReactElement { + render(): React.Element { return (