Skip to content

Commit

Permalink
Migrate ActivityIndicator to HostComponent
Browse files Browse the repository at this point in the history
Summary:
NativeComponent as a type isn't needed now that we have HostComponent

Changelog:
[Internal]

Reviewed By: zackargyle, rickhanlonii

Differential Revision: D18873494

fbshipit-source-id: 5ba3fa25537f8249c80c2303dcdb380e3b6b0ac5
  • Loading branch information
elicwhite authored and facebook-github-bot committed Dec 9, 2019
1 parent 6889003 commit 5215703
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Libraries/Components/ActivityIndicator/ActivityIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ const Platform = require('../../Utilities/Platform');
const React = require('react');
const StyleSheet = require('../../StyleSheet/StyleSheet');
const View = require('../View/View');

import type {NativeComponent} from '../../Renderer/shims/ReactNative';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
import type {ViewProps} from '../View/ViewPropTypes';

const PlatformActivityIndicator =
Expand Down Expand Up @@ -118,7 +117,10 @@ const ActivityIndicator = (props: Props, forwardedRef?: any) => {
);
};

const ActivityIndicatorWithRef = React.forwardRef(ActivityIndicator);
const ActivityIndicatorWithRef: React.AbstractComponent<
Props,
HostComponent<mixed>,
> = React.forwardRef(ActivityIndicator);
ActivityIndicatorWithRef.displayName = 'ActivityIndicator';

/* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an error
Expand Down Expand Up @@ -146,7 +148,4 @@ const styles = StyleSheet.create({
},
});

/* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an error
* found when Flow v0.89 was deployed. To see the error, delete this comment
* and run Flow. */
module.exports = (ActivityIndicatorWithRef: Class<NativeComponent<Props>>);
module.exports = ActivityIndicatorWithRef;

0 comments on commit 5215703

Please sign in to comment.