### Is this a bug report? Yes ### Have you read the [Contributing Guidelines](https://facebook.github.io/react-native/docs/contributing.html)? Yes ### Environment 1. `react-native -v`: ``` react-native-cli: 2.0.1 react-native: 0.48.2 ``` 2. `node -v`: ``` v8.4.0 ``` 3. `npm -v`: ``` 5.4.1 ``` 4. `flow version`: ``` Flow, a static type checker for JavaScript, version 0.51.1 ``` Then, specify: - Target Platform: N/A, Flow static typesystem - Development Operating System: macOS - Build tools: N/A, Flow static typesystem ### Steps to Reproduce 1. ```js render() { return <View ref={(view: ?View) => {}} />; } ``` 2. Flow errors out because it thinks View is a string. ### Expected Behavior View should be a `React.Component`. ### Actual Behavior 1. [`View` is the result of calling `requireNativeComponent()`](https://github.com/facebook/react-native/blob/master/Libraries/Components/View/View.js#L117) 2. [`requireNativeComponent` returns `React$ComponentType<any> | string`](https://github.com/facebook/react-native/blob/master/Libraries/ReactNative/requireNativeComponent.js#L52) 3. Consequently, Flow thinks `View` can be a `string` ### Reproducible Demo ```js // @flow import React from 'react'; import { View } from 'react-native'; class Test extends React.PureComponent { render() { return <View ref={(view: ?View) => {}} />; } } ```
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
react-native -v:node -v:npm -v:flow version:Then, specify:
Target Platform: N/A, Flow static typesystem
Development Operating System: macOS
Build tools: N/A, Flow static typesystem
Steps to Reproduce
Expected Behavior
View should be a
React.Component.Actual Behavior
Viewis the result of callingrequireNativeComponent()requireNativeComponentreturnsReact$ComponentType<any> | stringViewcan be astringReproducible Demo