From 49e1071e4cecec81557083b37431b48c240bc6c8 Mon Sep 17 00:00:00 2001 From: Eli White Date: Thu, 12 Dec 2019 14:21:24 -0800 Subject: [PATCH] Text: HostComponent instead of NativeComponent Summary: We can use the HostComponent type now instead of NativeComponent Changelog: [Internal] Reviewed By: zackargyle, rickhanlonii Differential Revision: D18871289 fbshipit-source-id: 3c70369c5848dedfc22ca6f6ccbb69d6d60a1330 --- Libraries/Text/Text.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index 92da79d4490..f523ba80db2 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -22,7 +22,7 @@ const nullthrows = require('nullthrows'); const processColor = require('../StyleSheet/processColor'); import type {PressEvent} from '../Types/CoreEventTypes'; -import type {NativeComponent} from '../Renderer/shims/ReactNative'; +import type {HostComponent} from '../Renderer/shims/ReactNativeTypes'; import type {PressRetentionOffset, TextProps} from './TextProps'; type ResponseHandlers = $ReadOnly<{| @@ -291,6 +291,12 @@ TextToExport.displayName = 'Text'; * and run Flow. */ TextToExport.propTypes = DeprecatedTextPropTypes; -module.exports = ((TextToExport: $FlowFixMe): Class< - NativeComponent, ->); +type TextStatics = $ReadOnly<{| + propTypes: typeof DeprecatedTextPropTypes, +|}>; + +module.exports = ((TextToExport: any): React.AbstractComponent< + TextProps, + React.ElementRef>, +> & + TextStatics);