From b77b760810c192a3b13149a467db934090d841c0 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Fri, 14 Oct 2016 10:40:15 -0700 Subject: [PATCH] RN: Fix Remaining ReactElement References Summary: Fixes remaining references to `ReactElement` that did not already have `React` in scope. Reviewed By: bestander, vjeux Differential Revision: D4022022 fbshipit-source-id: 4aeacee0cdbb2c825feba10282208316d064c578 --- Examples/UIExplorer/js/ExampleTypes.js | 12 +++++++----- .../NavigationTypeDefinition.js | 4 +++- Libraries/ReactNative/UIManager.js | 4 +++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Examples/UIExplorer/js/ExampleTypes.js b/Examples/UIExplorer/js/ExampleTypes.js index 7d0363016..bf5b7d67d 100644 --- a/Examples/UIExplorer/js/ExampleTypes.js +++ b/Examples/UIExplorer/js/ExampleTypes.js @@ -23,16 +23,18 @@ */ 'use strict'; +import type React from 'react'; + export type Example = { title: string, render: () => ?React.Element, description?: string, - platform?: string; + platform?: string, }; export type ExampleModule = { - title: string; - description: string; - examples: Array; - external?: bool; + title: string, + description: string, + examples: Array, + external?: bool, }; diff --git a/Libraries/NavigationExperimental/NavigationTypeDefinition.js b/Libraries/NavigationExperimental/NavigationTypeDefinition.js index b82efe3a1..af37f9549 100644 --- a/Libraries/NavigationExperimental/NavigationTypeDefinition.js +++ b/Libraries/NavigationExperimental/NavigationTypeDefinition.js @@ -13,6 +13,8 @@ const Animated = require('Animated'); +import type React from 'react'; + // Object Instances export type NavigationAnimatedValue = Animated.Value; @@ -112,7 +114,7 @@ export type NavigationAnimationSetter = ( export type NavigationSceneRenderer = ( props: NavigationSceneRendererProps, -) => ?ReactElement; +) => ?React.Element; export type NavigationStyleInterpolator = ( props: NavigationSceneRendererProps, diff --git a/Libraries/ReactNative/UIManager.js b/Libraries/ReactNative/UIManager.js index f902a78d3..e93ed5ba4 100644 --- a/Libraries/ReactNative/UIManager.js +++ b/Libraries/ReactNative/UIManager.js @@ -18,6 +18,8 @@ const defineLazyObjectProperty = require('defineLazyObjectProperty'); const findNodeHandle = require('react/lib/findNodeHandle'); const invariant = require('fbjs/lib/invariant'); +import type React from 'react'; + const { UIManager } = NativeModules; invariant(UIManager, 'UIManager is undefined. The native module config is probably incorrect.'); @@ -42,7 +44,7 @@ const _takeSnapshot = UIManager.takeSnapshot; * @platform ios */ UIManager.takeSnapshot = async function( - view ?: 'window' | ReactElement | number, + view ?: 'window' | React.Element | number, options ?: { width ?: number, height ?: number,